Advertise present, manage_goal, manage_tasks, and lsp conditionally - #357
Merged
Conversation
present now stays fully dispatchable but is discovered via tool_search instead of riding every request at 2,793 chars — the second-largest core tool schema for a feature most sessions never touch. manage_goal is advertised only when the session was resumed with an already-active goal, and lsp only when a language server was resolved at startup. Both facts are captured once, before the first inference call, since the wire tools array is a provider cache prefix: toggling either mid-session would force a re-prefill worse than the schema bytes saved. manage_tasks stays unconditional in both session modes — the goal-kickoff sequence calls manage_goal then manage_tasks back to back, so gating the second would trade one tool_search round trip for two.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
presentis removed from the advertised core set entirely; it stays fully dispatchable and is discovered viatool_search— at 2,793 chars it was the second-largest schema on the wire for a feature most sessions never use.manage_goalis advertised only when the session was resumed with an already-active/paused/budget-limited goal (checked once vialoadGoalStatebefore the first inference call), not whether a goal exists at the current instant.lspis advertised only when a language server was resolvable for the project at startup (src/agent/lsp-availability.tsmirrors@intx/tools-lsp's TypeScript server check: a resolvabletsserverplus a reachabletypescript-language-serverbinary), not whether one currently responds.manage_tasksstays unconditionally advertised in both session modes.goalKickoffUserMessage(src/agent/goal.ts) instructs the model to callmanage_goalthenmanage_tasksback to back whenever a goal starts — gating the second would trade onetool_searchround trip for two, which is the exact failure shapetask/search_agentswere promoted into the core set to avoid.ask_operatoris untouched.All four conditions are resolved once per session, before the toolset is built, and threaded through as an explicit
ToolAvailabilityvalue (hasGoalAtLaunch,languageServerAvailable) rather than re-derived mid-session, since the tools array is a provider cache prefix.Verification
bun run typecheck,bun run test(3957 pass), andbun run buildall pass.src/agent/tool-search.test.tscover:presentabsent from the core set,manage_goal/lspgated on availability,manage_tasks/ask_operatoradvertised unconditionally, and the built-in prefix staying byte-identical across repeated calls with the same session-start availability (simulating turns).src/agent/lsp-availability.test.tscoversdetectLanguageServerAvailableagainst a seeded temp project and against this repo's own checkout.presentfrom every session regardless of gate state.Closes CL-5588
Tradeoff:
manage_goalis gated on whether a goal exists at session start, soa goal set mid-session costs one
tool_searchround trip before the model cancall it. Most sessions neither start with nor acquire a goal, and the wire
array must stay fixed for the prompt cache, so this is the intended trade
rather than an oversight.