Skip to content

feat(tools): gate HTTP tool execution with session context#145

Merged
duguwanglong merged 2 commits intomainfrom
feat/tool-http-session-context
Apr 20, 2026
Merged

feat(tools): gate HTTP tool execution with session context#145
duguwanglong merged 2 commits intomainfrom
feat/tool-http-session-context

Conversation

@xiami762
Copy link
Copy Markdown
Contributor

@xiami762 xiami762 commented Apr 20, 2026

Summary

HTTP-triggered tool execution (execute, batch, test) now validates session/message context for permission-sensitive paths, and builtin tools require a verified session-backed request.

Changes

  • Server: Add sessionID / messageID / agent to execute, batch, and test payloads; validate session/message; build ToolContext with PermissionNext when appropriate; map permission denials to HTTP 403.
  • WebUI: Disable direct "Run test" for builtin tools; add EN/ZH copy explaining session-based testing.
  • Tests: Add tests/server/routes/test_tool_routes.py for the new behavior.

xiami762 added 2 commits April 20, 2026 11:15
- Require verified sessionID/messageID for builtin tools via HTTP APIs
- Build ToolContext with PermissionNext for session-backed execution
- WebUI: disable direct test for builtin tools with localized guidance
- Add unit tests for tool route session/permission behavior

Made-with: Cursor
Keep both the session-backed HTTP execution safeguards and the tool default-setting helpers so the merged tool routes stay consistent and fully covered by tests.

Made-with: Cursor
@xiami762 xiami762 requested a review from duguwanglong April 20, 2026 03:52
@duguwanglong duguwanglong merged commit 07a84af into main Apr 20, 2026
2 checks passed
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.

2 participants