Skip to content

Require ACP workspace conformance before execution#93

Merged
mingyooagi merged 1 commit into
mainfrom
codex/acp-workspace-conformance
Jul 14, 2026
Merged

Require ACP workspace conformance before execution#93
mingyooagi merged 1 commit into
mainfrom
codex/acp-workspace-conformance

Conversation

@mingyooagi

@mingyooagi mingyooagi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require the strict roles.agent.workspace.sessionCwd: "required" attestation for every ACP Agent manifest
  • reject omission during manifest/config parsing and executor construction instead of deferring failure to readiness
  • expose workspace conformance in doctor and Attempt capability snapshots, including repository-free and custom executors
  • document that the declaration is an integration attestation, not runtime proof or sandboxing

Validation

  • corepack pnpm build
  • corepack pnpm lint
  • corepack pnpm typecheck
  • corepack pnpm test — 119 files, 1531 tests passed
  • corepack pnpm release:check — packed-install CLI check passed
  • corepack pnpm smoke:governance -- --all — 7 cases passed
  • corepack pnpm smoke:privacy
  • git diff --check

Notes

  • ACP Agent manifests that omit the session-cwd contract are invalid; no compatibility or deferred-readiness path is retained.
  • Integrators must test real file tools in both repository worktrees and repository-free scratch directories before declaring conformance.
  • Readiness preflight remains part of the durable running Attempt so custom executor capability evidence is recorded even when readiness rejects.
  • Live third-party ACP agent real-tool conformance is intentionally not claimed by this PR.

Summary by CodeRabbit

  • New Features

    • Added explicit workspace session-directory conformance requirements for ACP agent configurations.
    • Executor capability and diagnostic output now report session working-directory conformance.
    • Doctor checks now validate configured agents, including repository-free setups and executor readiness.
  • Bug Fixes

    • Daemon runs are marked active before readiness checks, improving status reporting for early failures.
  • Documentation

    • Updated configuration, integration, security, and conformance guidance for session-directory handling and validation.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4289515-2617-4304-8ce0-a261a60c40d0

📥 Commits

Reviewing files that changed from the base of the PR and between 03a12a7 and cd45bdb.

📒 Files selected for processing (19)
  • docs/acp-agent-integration.md
  • docs/acp-first-agent-runtime-design.md
  • docs/configuration.md
  • docs/design.md
  • docs/integration-taxonomy.md
  • docs/superpowers/plans/2026-07-12-acp-first-agent-runtime.md
  • packages/cli/test/config.test.ts
  • packages/core/src/integration-protocol.ts
  • packages/core/test/integration-protocol.test.ts
  • packages/local-runtime/src/daemon.ts
  • packages/local-runtime/src/doctor.ts
  • packages/local-runtime/test/acp-daemon.test.ts
  • packages/local-runtime/test/config.test.ts
  • packages/local-runtime/test/doctor.test.ts
  • packages/runner/README.md
  • packages/runner/src/acp-executor.ts
  • packages/runner/src/executor.ts
  • packages/runner/test/acp-executor.test.ts
  • scripts/release/check-cli-package.mjs

📝 Walkthrough

Walkthrough

Agent manifests now require workspace.sessionCwd: "required". ACP executors expose CWD conformance, daemon readiness snapshots capability earlier, and doctor validates configured agents and executor workspace status.

Changes

ACP CWD conformance

Layer / File(s) Summary
Manifest contract and documentation
packages/core/src/integration-protocol.ts, packages/core/test/*, docs/*, packages/cli/test/config.test.ts, packages/local-runtime/test/config.test.ts
Agent roles require workspace.sessionCwd: "required", with parsing, configuration, and documentation updates covering the contract and rejection behavior.
Executor capability propagation
packages/runner/src/*, packages/runner/test/*
Executor capability contracts and ACP executors report declared or unverified workspace CWD conformance, with construction tests covering missing attestations.
Daemon readiness snapshot ordering
packages/local-runtime/src/daemon.ts, packages/local-runtime/test/acp-daemon.test.ts
markRunning records executor capability before readiness checks, while failed readiness cleans up scratch state and completes with the expected status.
Doctor capability diagnostics
packages/local-runtime/src/doctor.ts, packages/local-runtime/test/doctor.test.ts, packages/runner/README.md, scripts/release/check-cli-package.mjs
Doctor output reports CWD conformance, validates repository-free and secondary agents, and updates related assertions and capability documentation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Daemon as runOneDaemonIteration
  participant Client as DaemonClient
  participant Executor
  Daemon->>Client: markRunning with executorCapability
  Daemon->>Executor: canRun
  Executor-->>Daemon: readiness result
  Daemon->>Client: completeRun with needs_human on rejection
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/acp-workspace-conformance

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a workspace conformance check for ACP agents, requiring them to declare workspace.sessionCwd: "required" in their manifest to attest that their file tools honor the ACP session cwd. Without this declaration, agents are treated as unverified, and the runtime will fail closed. The changes span documentation, schema validation, executor logic, and doctor checks, along with extensive test coverage. The reviewer suggested adding a fallback default value when mapping repository.defaultExecutor in the doctor checks to prevent undefined from being added to the executor IDs set.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

}
}

const repositoryExecutorIds = new Set(input.config.repositories.map((repository) => repository.defaultExecutor));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If repository.defaultExecutor is optional or undefined in the raw configuration, map could return undefined, adding undefined to the repositoryExecutorIds Set. To prevent any potential runtime type mismatches or unexpected Set behavior, consider adding a fallback default value (e.g., "echo") during the mapping.

Suggested change
const repositoryExecutorIds = new Set(input.config.repositories.map((repository) => repository.defaultExecutor));
const repositoryExecutorIds = new Set(input.config.repositories.map((repository) => repository.defaultExecutor ?? "echo"));

@mingyooagi
mingyooagi force-pushed the codex/acp-workspace-conformance branch from 6830719 to 0a8d72e Compare July 14, 2026 10:31
Generic ACP previously advertised worktree isolation whenever the host created a worktree, even though ACP only forwards a session cwd. Require a strict manifest attestation during schema and config parsing, remove the deferred-readiness compatibility path, and preserve capability evidence in doctor and Attempt audit surfaces.

Constraint: ACP v1 transports session cwd but does not attest how an agent real file tools resolve workspace paths
Rejected: Accept old manifests and defer rejection to executor readiness | a security contract should fail at manifest parsing instead of preserving an ambiguous compatibility state
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Do not declare ACP session-cwd conformance until real file tools pass both worktree and scratch tests
Tested: pnpm build; pnpm lint; pnpm typecheck; pnpm test (119 files, 1531 tests); pnpm release:check; 7 governance matrix cases; privacy redaction scan; git diff --check; standards and spec review
Not-tested: Live third-party ACP agent real-tool conformance
@mingyooagi
mingyooagi force-pushed the codex/acp-workspace-conformance branch from 0a8d72e to cd45bdb Compare July 14, 2026 11:55
@mingyooagi
mingyooagi marked this pull request as ready for review July 14, 2026 12:05
@mingyooagi
mingyooagi merged commit d072cdd into main Jul 14, 2026
1 of 2 checks passed
mingyooagi added a commit that referenced this pull request Jul 15, 2026
* Gate OpenClaw before admitting it to the generic ACP path

OpenClaw 2026.7.1 initializes through the generic ACP host and passes real worktree, scratch, and disposable-session checks. A hardened cancellation canary proves that the in-flight shell can outlive ACP and Gateway cancellation, so the live registry records the blocker and no manifest example ships.

Constraint: ACP Agent manifests require the sessionCwd attestation before executor construction

Rejected: Publish an OpenClaw manifest after the partial pass | cancellation still permits a late external effect

Rejected: Add an OpenClaw-specific executor | the integration boundary remains the generic ACP host

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Do not publish the OpenClaw manifest or weaken the cancellation canary until the late completion marker no longer appears

Tested: typecheck; lint; 1534 unit and integration tests; build; 7-case governance matrix; privacy scan; publication set; two real OpenClaw 2026.7.1 Gateway runs

Not-tested: Remote authenticated Gateway

Related: #93

* Keep the OpenClaw gate reliable under real setup noise

The conformance harness now tolerates diagnostic lines before the CLI version, preserves leak detection when the configured default workspace does not exist yet, and guarantees fixture cleanup when setup fails after temporary-root creation.

Constraint: The gate must stay fail closed for provider behavior while remaining reusable in clean environments.
Rejected: Accept the review suggestions verbatim | unanchored version matching and an unnormalized workspace fallback would weaken the evidence boundary.
Confidence: high
Scope-risk: narrow
Directive: Do not turn missing-workspace handling into automatic workspace creation or provider admission.
Tested: targeted OpenClaw harness tests; typecheck; lint; 120 test files and 1536 tests
Not-tested: live OpenClaw cancellation, which remains the recorded upstream provider failure.

* Keep conformance failures bounded and non-destructive

The live gate now enforces private report permissions on overwrite, bounds synchronous provider probes, authorizes cleanup only after marker absence is established, and settles the ACP run when cancellation-marker observation fails.

Constraint: A failing provider gate must not hang indefinitely, weaken evidence privacy, delete pre-existing files, or leave an executor running during fixture cleanup.
Rejected: Treat the bot findings as optional hardening | each finding reproduces a real failure or safety boundary in the current harness.
Confidence: high
Scope-risk: narrow
Directive: Keep cleanup ownership explicit and settle every started executor before removing its workspace.
Tested: 8 targeted harness tests; typecheck; lint; 120 test files and 1539 tests
Not-tested: live OpenClaw cancellation remains the recorded upstream provider failure.
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