Skip to content

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

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

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

github-actions Bot commented Jul 7, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant