Uh oh!
There was an error while loading. Please reload this page.
feat(core): configure tool availability per session - #35691
Conversation
Add a public API endpoint and event-sourced mechanism for enabling or disabling tools on a per-session basis. Clients can POST a map of tool names to booleans which gets translated into Permission.Ruleset entries and composed with agent-level permissions at materialization time (session rules win via findLast semantics).
The following comment was made by an LLM, it may be inaccurate: I found one potentially related PR:
This PR appears related as it also deals with tool visibility and session permissions, which is closely aligned with the current PR's focus on configuring tool availability per session. However, this appears to be an older PR (from the numbering). I recommend verifying whether #17089 has already been merged and if the current PR (35691) addresses any gaps or extends that functionality. |
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes#35647
Type of change
What does this PR do?
Implements session-scoped tool configuration through a new
POST /api/session/:sessionID/configureendpoint.The endpoint accepts
{tools: {bash: false, edit: true}}and translates that into Permission.Ruleset entries stored via a durablesession.tools.configuredevent. At materialization time, session rules are appended after agent permissions so they win via findLast semantics inwhollyDisabled().Passing tools as undefined clears session overrides.
How did you verify your code works?
bun run migration, SDK regenerated withbun run generateScreenshots / recordings
N/A
Checklist