Skip to content

feat(core): configure tool availability per session - #35691

Closed
ksamirdev wants to merge 1 commit into
anomalyco:v2from
ksamirdev:feat/session-tool-config
Closed

feat(core): configure tool availability per session#35691
ksamirdev wants to merge 1 commit into
anomalyco:v2from
ksamirdev:feat/session-tool-config

Conversation

@ksamirdev

Copy link
Copy Markdown

Issue for this PR

Closes#35647

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Implements session-scoped tool configuration through a new POST /api/session/:sessionID/configure endpoint.

The endpoint accepts {tools: {bash: false, edit: true}} and translates that into Permission.Ruleset entries stored via a durable session.tools.configured event. At materialization time, session rules are appended after agent permissions so they win via findLast semantics in whollyDisabled().

Passing tools as undefined clears session overrides.

How did you verify your code works?

  • Typecheck passes across all packages (schema, core, protocol, server, client, sdk-next)
  • event-manifest test updated and green
  • Migration generated with bun run migration, SDK regenerated with bun run generate

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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).
@github-actions

Copy link
Copy Markdown
Contributor

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.

@ksamirdev
ksamirdev marked this pull request as ready for review July 7, 2026 08:38
@github-actions

Copy link
Copy Markdown
Contributor

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:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

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.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ksamirdev