feat(gateway): add session workspace binding - #37275
Conversation
|
Thanks for this @qWaitCrypto — the use case is real and well-argued (one gateway bot serving multiple repos), and the writeup in #37277 is excellent. Closing this one without merging, though, because most of it duplicates machinery that landed in the ~300 commits since your branch's base. The per-session cwd mechanism you're rebuilding already exists on
So merging this as-is would fork the cwd mechanism — it introduces a parallel The one genuinely-missing piece is the messaging-gateway slash command: I'd rather rebuild that thin slice fresh against current |
What does this PR do?
Adds session-scoped workspace binding for messaging gateway sessions.
Gateway users can now run
/workspace <absolute-path>or/cwd <absolute-path>to bind the current chat/thread to a project directory. Subsequent agent turns in that gateway session resolve runtime cwd, context files, terminal commands, file tools, code execution, delegation hints, checkpoints, and runtime footer/status output against the bound workspace instead of the globalterminal.cwd.This keeps the existing default behavior unchanged when no workspace is bound, while making multi-chat and multi-repo gateway usage practical without running one bot process per project.
Related Issue
#37277
Type of Change
Changes Made
/workspaceand/cwdgateway commands for showing, setting, and clearing the current session workspace.SessionDB.sessions.cwd, including resume/session-switch handling.How to Test
Run the focused test suite:
In a gateway session, run
/workspace /absolute/path/to/project.Ask the agent to read a relative file or run
pwd; it should use the bound workspace.Run
/workspace clearand confirm the session returns to the global gateway cwd.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) - or N/Acli-config.yaml.exampleif I added/changed config keys - or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - or N/AScreenshots / Logs
Focused tests passed locally: