feat(agents): support direct CLI workspaces - #213
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR enables local agent CLI commands to infer a workspace directly from the current Git repository without requiring an injected workspace ID. It also makes workspace IDs optional across the daemon protocol, manager, and store, tightens CLI option parsing, and increments the daemon protocol version.
Confidence Score: 4/5The symlink-sensitive workspace validation should be fixed before merging because it prevents valid direct agent commands from operating inside configured allowed roots. The new resolver validates Git and injected workspace paths lexically, so equivalent symlinked and canonical paths can be treated as different locations and valid commands fail before reaching the daemon. Files Needing Attention: src/cli-workspace.ts
|
| Filename | Overview |
|---|---|
| src/cli-workspace.ts | Adds direct workspace inference, but lexical allowed-root validation rejects valid symlink-equivalent repository paths. |
| src/cli.ts | Routes agent commands through inferred workspace context and introduces stricter, separator-aware JSON option parsing. |
| src/local-agent-manager.ts | Allows root-only agent scopes while retaining workspace-ID matching when an ID is supplied. |
| src/local-agent-daemon-protocol.ts | Updates protocol decoding so workspace IDs are optional in agent records and request scopes. |
| src/local-agent-store.ts | Supports nullable workspace IDs and existing root-only list filtering. |
| src/local-agent-targets.ts | Adds explicit option termination and rejects unrecognized dash-prefixed options. |
Sequence Diagram
sequenceDiagram
participant U as CLI user
participant C as devspace agents
participant W as Workspace resolver
participant D as Agent daemon
participant M as Agent manager/store
U->>C: agents command
C->>W: resolve env root or Git top-level
W->>W: enforce configured allowed roots
W-->>C: workspaceRoot + optional workspaceId
C->>D: authenticated protocol v3 request
D->>M: root/ID-scoped operation
M-->>D: agent record(s) or scope error
D-->>C: structured result
Reviews (1): Last reviewed commit: "fix(agents): reject ambiguous CLI option..." | Re-trigger Greptile
9c38fb2 to
f1444ed
Compare
f1444ed to
b9d0d0f
Compare
Subagent commands currently depend on MCP-injected workspace state, which prevents the same tooling from working naturally in Codex, Pi, OpenCode, Claude Code, and other local harnesses. This layer lets the daemon accept a workspace root without a workspaceId and resolves direct CLI scope from injected MCP context, then the Git root, then the current directory.
It also makes argument parsing strict: unknown options and the removed --thinking option fail clearly, while a literal option after -- remains part of the prompt. Session lists remain workspace-scoped in both MCP and direct CLI use.
This is layer 2 of 4, based on #212. The next layer is #214. Verified with the full test suite, TypeScript typecheck, and packaged build.