Skip to content

Conversation

@athal7
Copy link
Contributor

@athal7 athal7 commented Jan 8, 2026

Summary

  • Add /cd <path> command to change the working directory mid-conversation
  • Support !cd shell mode for directory navigation
  • Add CdTool for agents to change directories programmatically
  • Add POST /cd endpoint and plugin API (setDirectory) for programmatic use
  • Fix TUI event routing to survive directory changes via GlobalBus
  • Regenerate SDK with /cd endpoint and EventInstanceDirectoryChanged type

Fixes #2177

athal7 added 5 commits January 7, 2026 12:13
Implements /cd command to allow users to change the working directory
mid-conversation. Supports /cd command syntax, !cd shell mode, and
CdTool for agents. Includes plugin API (setDirectory) and POST /cd
endpoint for programmatic use.

Fixes anomalyco#2177
Add handler for instance.directory.changed event to update the TUI's
path display when the user changes directories using the /cd command.
The /event SSE endpoint used Bus.subscribeAll() which stores subscriptions
per-directory via Instance.state(). When Instance.setDirectory() was called
via /cd, it disposed the old state, removing the SSE subscription.

Switch to GlobalBus which persists across directory changes, filtering
events by current directory and following directory changes via the
instance.directory.changed event.
- Add SessionStatus.set(idle) so 'run' command knows /cd completed
- Add time.start/end to text part so output appears in 'run' command
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@athal7 athal7 marked this pull request as ready for review January 8, 2026 00:20
@athal7 athal7 requested a review from adamdotdevin as a code owner January 8, 2026 00:20
@athal7 athal7 changed the title feat(opencode): add /cd command for changing working directory feat: add /cd command for changing working directory Jan 8, 2026
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.

Allow explicitly changing working directory

1 participant