GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — core: refactor tool system to remove agent context from initialization by thdxr · Pull Request #21052 · anomalyco/opencode Conversation
Member
SummaryRefactor the tool system to simplify initialization and remove unnecessary agent context dependencies. This makes tool behavior more predictable and consistent across different agents. Changes
WhyPreviously, tools received agent context during initialization which led to:
Now tools are initialized once and behave consistently regardless of the calling agent.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
fyi this removes the agent permission filtering from tool init - we'll need to add that back at execution time instead. right now task/skill tools show everything regardless of whether the agent can actually use them. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Simplify tool initialization by removing unnecessary agent context parameter from tool.init() calls. This makes tool behavior more predictable and consistent regardless of which agent is using them. Replace hardcoded named tool references (registry.named.task, registry.named.read) with a cleaner fromID() lookup method that works for any tool. Update TaskTool to display all available subagents without permission-based filtering, making it easier to discover and use subagents from any context.
Skills are now displayed in alphabetical order when listing available skills, making it easier for users to locate specific skills in the output.
Document two approaches for handling synthetic messages in prompt hooks: - Option 1: Separate PromptMessage type for lightweight prompt surgery - Option 2: PromptEditor API with append/prepend/insert mutators This enables plugin developers to inject instructions or context into prompts without manually fabricating message IDs and timestamps. The design supports resumable sessions while keeping the API simple for common prompt manipulation use cases.
Fixed the compaction system to properly convert internal message format to model message format before sending to LLM for summarization. This ensures session compaction works reliably across different providers. - Use MessageV2.toModelMessagesEffect to convert messages with media stripped - Fix hasToolCalls to work with ModelMessage[] format - Pass message history to tool execution context during compaction
Dynamically populate the skill and task tool descriptions with lists of available skills and agent types. This helps users see what specialized capabilities are available before invoking these tools, rather than discovering them through trial and error.
There was an error while loading. Please reload this page.
* fix: bump openrouter ai sdk pkg to fix openrouter issues (anomalyco#21242) * chore: update nix node_modules hashes * chore: remove ai-sdk/provider-utils patch and update pkg (anomalyco#21245) * chore: update nix node_modules hashes * chore: bump anthropic ai sdk pkg, delete patch (anomalyco#21247) * refactor(core): add full http proxy and change workspace adaptor interface (anomalyco#21239) * go: add mimo * feat: add --dangerously-skip-permissions flag to opencode run (anomalyco#21266) * chore: update nix node_modules hashes * feat(opencode): Add PDF attachment Drag and Drop (anomalyco#16926) Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Aiden Cline <[email protected]> * feat(app): show full names on composer attachment chips (anomalyco#21306) * style(app): redesign jump-to-bottom button per figma spec (anomalyco#21313) * Move auto-accept permissions to settings (anomalyco#21308) * go: support coupon * fix(opencode): keep user message variants scoped to model (anomalyco#21332) * chore: generate * chore: update web stats * feat(app): better subagent experience (anomalyco#20708) * refactor(core): support multiple event streams in worker and remove workspaces from plugin api (anomalyco#21348) * fix(tui): use sentence case for theme mode command palette items (anomalyco#21192) Co-authored-by: Aiden Cline <[email protected]> * fix: ensure the alibaba provider errors are retried (anomalyco#21355) * fix(opencode): improve console login transport errors (anomalyco#21350) * chore: generate * feat(tui): allow variant_list keybind for the "Switch model variant" command (anomalyco#21185) Co-authored-by: Aiden Cline <[email protected]> * test: disable GPG signing in test fixtures (anomalyco#20386) * fix(opencode): clear webfetch timeouts on failed fetches (anomalyco#21378) * feat(opencode): add OTLP observability support (anomalyco#21387) * zen: glm5.1 doc * zen: glm5.1 doc * go: glm5.1 * core: refactor tool system to remove agent context from initialization (anomalyco#21052) * refactor(snapshot): store unified patches in file diffs (anomalyco#21244) Co-authored-by: Adam <[email protected]> * chore: generate * release: v1.4.0 * chore: update nix node_modules hashes * fix(tui): simplify console org display (anomalyco#21339) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * ui: fix sticky session diffs header (anomalyco#21486) * test: update webfetch test (anomalyco#21398) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * fix: ensure that /providers list and shell endpoints are correctly typed in sdk and openapi schema (anomalyco#21543) * fix(app): patch tool diff rendering * fix(app): diff list normalization * fix: dont show invalid variants for BP (anomalyco#21555) * tweak: separate ModelsDev.Model and Config model schemas (anomalyco#21561) * refactor(effect): build task tool from agent services (anomalyco#21017) * fix(app): skip url password setting for same-origin server and web app (anomalyco#19923) * fix: propagate abort signal to inline read tool (anomalyco#21584) * refactor(effect): inline session processor interrupt cleanup (anomalyco#21593) * feat(llm): integrate GitLab DWS tool approval with permission system (anomalyco#19955) Co-authored-by: Aiden Cline <[email protected]> * chore: update nix node_modules hashes * fix(lsp): remove CMakeLists.txt and Makefile from clangd root markers (anomalyco#21466) * Remove CLI from electron app (anomalyco#17803) Co-authored-by: LukeParkerDev <[email protected]> * chore: generate * chore: update nix node_modules hashes * feat: add opencode go upsell modal when limits are hit (anomalyco#21583) Co-authored-by: Frank <[email protected]> * release: v1.4.1 * app: remove min loading duration (anomalyco#21655) * fix: preserve interrupted bash output in tool results (anomalyco#21598) * fix: preserve text part timing in session processor (anomalyco#21691) * refactor(effect): drop shell abort signals from runner (anomalyco#21599) * refactor: fix tool call state handling and clean up imports (anomalyco#21709) * release: v1.4.2 * feat(mcp): add OAuth redirect URI configuration for MCP servers (anomalyco#21385) Co-authored-by: Aiden Cline <[email protected]> * chore: generate * fix(tui): restore hidden session scrollbar default (anomalyco#20947) * feat: add support for fast modes for claude and gpt models (that support it) (anomalyco#21706) * opencode: lazy-load top-level CLI commands The CLI imports every top-level command before argument parsing has decided which handler will run. This makes simple invocations pay for the full command graph up front and slows down the default startup path. Parse the root argv first and load only the command module that matches the selected top-level command. Keep falling back to the default TUI path for non-command positionals, and preserve root help, version and completion handling * delete unused withALS method (anomalyco#21723) * Revert "opencode: lazy-load top-level CLI commands" (anomalyco#21726) * fix(effect): suspend agent default layer construction (anomalyco#21732) --------- Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: James Long <[email protected]> Co-authored-by: Frank <[email protected]> Co-authored-by: gitpush-gitpaid <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Shoubhit Dash <[email protected]> Co-authored-by: Dax <[email protected]> Co-authored-by: Adam <[email protected]> Co-authored-by: Ariane Emory <[email protected]> Co-authored-by: Kit Langton <[email protected]> Co-authored-by: Kyle Altendorf <[email protected]> Co-authored-by: opencode <[email protected]> Co-authored-by: Brendan Allan <[email protected]> Co-authored-by: OpeOginni <[email protected]> Co-authored-by: Vladimir Glafirov <[email protected]> Co-authored-by: Cho HyeonJong <[email protected]> Co-authored-by: LukeParkerDev <[email protected]> Co-authored-by: Aleksandr Lossenko <[email protected]> Co-authored-by: Simon Klee <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.