Skip to content

feat(agents): support direct CLI workspaces - #213

Open
Waishnav wants to merge 7 commits into
codex/v11-agent-effortfrom
codex/v11-agent-cli-scope
Open

feat(agents): support direct CLI workspaces#213
Waishnav wants to merge 7 commits into
codex/v11-agent-effortfrom
codex/v11-agent-cli-scope

Conversation

@Waishnav

@Waishnav Waishnav commented Aug 20, 2026

Copy link
Copy Markdown
Owner

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a707f7c1-d373-41df-90bd-4429c132f753

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Waishnav Waishnav changed the title codex/v11 agent cli scope feat(agents): support direct CLI workspaces Aug 20, 2026
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

The 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.

  • Adds direct CLI workspace-root inference and allowed-root validation.
  • Supports root-scoped agent creation, lookup, continuation, and listing.
  • Rejects ambiguous CLI options while preserving literal dash-prefixed prompts after --.
  • Updates protocol, manager, store, and integration tests for optional workspace IDs.

Confidence Score: 4/5

The 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

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "fix(agents): reject ambiguous CLI option..." | Re-trigger Greptile

Comment thread src/cli-workspace.ts Outdated
@Waishnav
Waishnav force-pushed the codex/v11-agent-cli-scope branch from 9c38fb2 to f1444ed Compare August 20, 2026 09:15
@Waishnav
Waishnav force-pushed the codex/v11-agent-cli-scope branch from f1444ed to b9d0d0f Compare August 20, 2026 09:19
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