Skip to content

fix: keep ACP turns on OpenClaw timeouts#82997

Merged
steipete merged 1 commit into
mainfrom
fix/acp-acpx-timeout-success
May 17, 2026
Merged

fix: keep ACP turns on OpenClaw timeouts#82997
steipete merged 1 commit into
mainfrom
fix/acp-acpx-timeout-success

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Fix ACP/acpx turns so the embedded adapter no longer applies its prompt timeout to OpenClaw-managed turns, preventing partial progress text from being converted into a successful completion.
  • Keep the acpx constructor timeout for startup/control operations and document plugin timeoutSeconds as a startup-probe/runtime-operation guard, not the ACP turn deadline.
  • Add regression coverage for delegate turn timeout disabling and manager partial-progress timeouts.

Fixes #79522

Verification

  • node scripts/run-vitest.mjs extensions/acpx/src/runtime.test.ts -t "disables delegate prompt timeout"
  • node scripts/run-vitest.mjs extensions/acpx/src/service.test.ts
  • node scripts/run-vitest.mjs src/acp/control-plane/manager.test.ts -t "times out a hung persistent turn after partial progress"
  • pnpm exec oxfmt --check --threads=1 extensions/acpx/src/service.ts extensions/acpx/src/service.test.ts extensions/acpx/src/runtime.ts extensions/acpx/src/runtime.test.ts src/acp/control-plane/manager.test.ts extensions/acpx/openclaw.plugin.json docs/tools/acp-agents-setup.md CHANGELOG.md
  • git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode local

Behavior addressed: ACP/Codex background runs no longer let acpx synthesize a completed turn from partial progress after its adapter timeout.
Real environment tested: local OpenClaw checkout with acpx 0.7.0 package behavior inspected and focused Vitest coverage.
Exact steps or command run after this patch: focused runtime/service/manager Vitest commands above plus Codex review, format check, and diff check.
Evidence after fix: runtime wrapper passes timeoutMs 0 to delegate runTurn while service still passes constructor timeoutMs for non-turn runtime operations; manager partial-progress timeout test records ACP_TURN_FAILED instead of success.
Observed result after fix: all focused tests passed; Codex review reported no actionable regressions.
What was not tested: no live Codex ACP adapter run against a real long-running prompt in this PR.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: acpx size: S maintainer Maintainer-authored PR labels May 17, 2026
@clawsweeper

clawsweeper Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR disables the acpx delegate prompt timeout for AcpxRuntime.runTurn, updates acpx timeout docs and manifest copy, and adds focused ACP/acpx regression tests.

Reproducibility: yes. from source inspection: acpx 0.7.0 applies input.timeoutMs ?? options.timeoutMs to prompt turns and can complete after partial output, while OpenClaw routes managed acpx turns through startTurn. I did not run a live long-running adapter repro in this read-only pass.

Real behavior proof
Not applicable: Not applicable: this is a maintainer-labeled PR, so the external contributor proof gate does not apply; the body records focused local tests and explicitly notes no live long-running Codex ACP adapter run.

Next step before merge
Maintainer review is needed because the protected PR has a concrete correctness blocker in the startTurn path before it can land.

Security
Cleared: Cleared: the diff touches ACP/acpx runtime behavior, docs, tests, and changelog only, with no new dependencies, workflows, install scripts, permissions, or secret-handling changes.

Review findings

  • [P1] Disable the startTurn timeout path too — extensions/acpx/src/runtime.ts:1038
Review details

Best possible solution:

Apply the no-prompt-timeout override to the AcpxRuntime.startTurn delegate path as well, while keeping the constructor timeout for startup/control operations and covering the registered-backend startTurn path in tests.

Do we have a high-confidence way to reproduce the issue?

Yes from source inspection: acpx 0.7.0 applies input.timeoutMs ?? options.timeoutMs to prompt turns and can complete after partial output, while OpenClaw routes managed acpx turns through startTurn. I did not run a live long-running adapter repro in this read-only pass.

Is this the best way to solve the issue?

No: changing only runTurn is not the best fix because the manager uses startTurn when available. The narrow maintainable fix is to pass timeoutMs: 0 into the delegate startTurn call and test that path.

Full review comments:

  • [P1] Disable the startTurn timeout path too — extensions/acpx/src/runtime.ts:1038
    The new timeout override only wraps delegate.runTurn(...), but OpenClaw-managed acpx turns normally go through service.startTurn and consumeAcpTurnStream, which call AcpxRuntime.startTurn. That method still forwards delegate.startTurn(input), so acpx 0.7.0 falls back to the constructor timeout and can still synthesize a completed turn after partial output. Please pass the no-timeout override through the startTurn delegate path and cover that path in the regression test.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.9

Acceptance criteria:

  • node scripts/run-vitest.mjs extensions/acpx/src/runtime.test.ts -t "disables delegate prompt timeout"
  • node scripts/run-vitest.mjs extensions/acpx/src/service.test.ts
  • node scripts/run-vitest.mjs src/acp/control-plane/manager.test.ts -t "times out a hung persistent turn after partial progress"
  • git diff --check

What I checked:

  • OpenClaw uses startTurn when available: consumeAcpTurnStream prefers runtime.startTurn(params.turn) and only falls back to runtime.runTurn, so the acpx backend normally follows the startTurn path for managed turns. (src/acp/control-plane/manager.turn-stream.ts:115, 327b0b8734d5)
  • Registered acpx backend exposes startTurn: The lazy acpx service registers a startTurn method and routes manager calls through startRuntimeTurn, so disabling only runTurn does not cover the main runtime path. (extensions/acpx/src/service.ts:256, 327b0b8734d5)
  • startTurn still forwards the original input: Current AcpxRuntime.startTurn delegates with delegate.startTurn(input); the PR patch shown in the supplied context changes delegate.runTurn but not this startTurn delegate call. (extensions/acpx/src/runtime.ts:1038, 327b0b8734d5)
  • acpx timeout contract: The published acpx 0.7.0 runtime type includes AcpRuntimeTurnInput.timeoutMs; its runtime implementation uses input.timeoutMs ?? this.options.timeoutMs for prompt turns and treats a timeout after an observed agent reply as a completed turn, which is the behavior this PR is trying to suppress.
  • Recent feature history: Commit 635b947 introduced the current startTurn terminal-result path and related ACP/acpx tests, making it the relevant current-main provenance for this surface. (extensions/acpx/src/runtime.ts:1026, 635b947e32e0)

Likely related people:

  • steipete: Recent current-main history shows Peter Steinberger introduced the startTurn terminal-result handling and related ACP/acpx tests in commit 635b947; blame also points to that commit for AcpxRuntime.startTurn. (role: recent ACP/acpx feature owner; confidence: high; commits: 635b947e32e0; files: extensions/acpx/src/runtime.ts, extensions/acpx/src/service.ts, src/acp/control-plane/manager.turn-stream.ts)

Remaining risk / open question:

  • No live long-running ACP/Codex adapter run was executed during this read-only review, so the verdict is based on source and acpx package-contract proof rather than live runtime proof.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 327b0b8734d5.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. labels May 17, 2026
@steipete
steipete force-pushed the fix/acp-acpx-timeout-success branch from dbd3eed to 0080f39 Compare May 17, 2026 08:10
@steipete

Copy link
Copy Markdown
Contributor Author

Rebased onto current origin/main and resolved conflicts around the newer ACP terminal-result handling.

Verification after rebase:

  • node scripts/run-vitest.mjs extensions/acpx/src/runtime.test.ts -t "disables delegate prompt timeout"
  • node scripts/run-vitest.mjs extensions/acpx/src/service.test.ts
  • node scripts/run-vitest.mjs src/acp/control-plane/manager.test.ts -t "times out a hung persistent turn after partial progress"
  • pnpm exec oxfmt --check --threads=1 extensions/acpx/src/service.ts extensions/acpx/src/service.test.ts extensions/acpx/src/runtime.ts extensions/acpx/src/runtime.test.ts src/acp/control-plane/manager.test.ts extensions/acpx/openclaw.plugin.json docs/tools/acp-agents-setup.md CHANGELOG.md
  • git diff --check origin/main...HEAD
  • /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode branch --base origin/main

Codex review also reran node scripts/run-vitest.mjs extensions/acpx/src/runtime.test.ts extensions/acpx/src/service.test.ts src/acp/control-plane/manager.test.ts: 3 files passed, 141 tests passed.

GitHub status: no required checks reported for this branch at merge time; newly queued non-required checks were still in progress.

@steipete
steipete merged commit 83e19ca into main May 17, 2026
102 of 103 checks passed
@steipete
steipete deleted the fix/acp-acpx-timeout-success branch May 17, 2026 08:10
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 20, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: acpx impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ACP/Codex run reports success after only initial progress text in 2026.5.7

1 participant