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 — refactor(core)!: call the session tools opencode.session.rename and .move in Code Mode by rekram1-node · Pull Request #65080 · anomalyco/opencode Conversation
|
| Code Mode before | Code Mode after | Direct name / permission action |
|---|---|---|
tools.opencode.session_rename |
tools.opencode.session.rename |
opencode_session_rename (unchanged) |
tools.opencode.session_move |
tools.opencode.session.move |
opencode_session_move (unchanged) |
Called directly (Code Mode off or execute denied), the names stay the same, because the runtime already turns dots in a namespace into underscores. So permission rules and saved approvals keep working and need no translation.
What breaks: programs that call the old Code Mode paths, including stored code automations, which now fail with an unknown tool. The list of tools automations may not call (automation/code.ts) uses the new paths. The worktree hint in opencode.ts and the tools.mdx docs are updated too.
Other opencode tools (worktree, automation, artifact, MCP, models) keep their current names for now.
packages/core: typecheck:tsc; tool-opencode, automation, tool-model-policy and tool-automation tests pass (65).N/A
Added by the opencode bot (AI-generated).
Public API: renames Code Mode paths tools.opencode.session_rename/session_move → tools.opencode.session.rename/.move (old Code Mode paths break; direct names and permission actions unchanged)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…move in Code Mode
3fa42b7 to
7a2d559
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The rename looks sound. I ran the closest core tests (the one failure also fails on the base) and the core type check (typecheck:tsc), which passes. The updated tests exercise the new nested Code Mode paths end to end and confirm the direct tool IDs are unchanged.
Public API impact (not fully backwards compatible):
opencode.session_* / worktree_* / automation_* / artifact_* → opencode.<noun>.<verb>. list_mcp_resources / read_mcp_resource / list_mcp_events → opencode.mcp.resource.list / .read, opencode.mcp.event.list. Programs and stored code automations using the old paths now fail as unknown tools.opencode_list_mcp_resources → opencode_mcp_resource_list, opencode_read_mcp_resource → opencode_mcp_resource_read, opencode_list_mcp_events → opencode_mcp_event_list. Old names are mapped only for config rules and saved approvals (see inline comment). Plugins that match on the old direct tool IDs need updating.One concern, inline: old action names are not mapped for rules attached to a session or for plugin-defined agents.
packages/core/src/permission.ts:104: currentAction only runs where config rules are loaded (config/plugin/agent.ts) and where saved approvals are read. Two other rule sources skip it: - session-level permissions (set through the session create/update HTTP API and stored on the session) - agents whose permissions come from a plugin instead of config In both cases a rule like opencode_read_mcp_resource: deny quietly stops applying once this lands. Applying the mapping where rules are matched (evaluate, or merge) would cover every source in one place and make the call in expandPermissions unnecessary.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The narrowed change looks sound. I ran the closest core tests (115 pass, including the new tool-registry test) and the core type check (typecheck:tsc), which passes.
My earlier concern about mapping old permission action names no longer applies: this version renames no actions.
Public API impact, not backwards compatible for Code Mode callers: tools.opencode.session_rename → tools.opencode.session.rename and tools.opencode.session_move → tools.opencode.session.move. Programs and stored code automations that use the old paths now fail as unknown tools. Direct tool names and permission actions (opencode_session_rename, opencode_session_move) are unchanged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.