openclaw - ✅(Solved) Fix ACP startup identity reconcile warns on terminal one-shot sessions [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72013Fetched 2026-04-27 05:36:06
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
referenced ×4cross-referenced ×1

Gateway startup currently tries to reconcile persisted ACP session identities even when those records are terminal one-shot ACP sessions. If the stored identity remains pending, startup logs a scary warning like:

[gateway] acp startup identity reconcile (renderer=v1): checked=7 resolved=0 failed=7

In this case fresh ACP launches still worked for both Codex and Claude, so the warning appears to be stale terminal metadata rather than a current ACP runtime failure.

Error Message

  1. Some records were idle/successful one-shot smoke sessions; some were historical error sessions. There may be an even better source-level fix: mark successful one-shot identities as resolved before closing, or classify closed one-shot records separately. But startup should not warn as if active ACP is unhealthy when only terminal one-shot metadata is unresolved.

Root Cause

The warning makes it look like ACP/Codex/Claude agent routing is broken, even though fresh ACP sessions are healthy. It also gets repeated on every gateway restart until stale records are manually archived.

Fix Action

Fix / Workaround

In AcpSessionManager.reconcilePendingSessionIdentities, skip terminal records before attempting runtime re-ensure/reconcile. Local mitigation that cleared the warning:

PR fix notes

PR #72023: fix(acp): skip terminal one-shot/closed sessions in startup identity reconcile (#72013)

Description (problem / solution / changelog)

Summary

Fixes #72013.

`AcpSessionManager.reconcilePendingSessionIdentities` iterates all persisted ACP sessions and tries to resolve any whose identity is `pending`. One-shot records always stay `pending` because they complete without resolving the long-lived runtime session identity — that's by design.

The reconciler attempts to ensure them anyway, fails, and produces scary gateway startup log lines:

``` [gateway] acp startup identity reconcile (renderer=v1): checked=7 resolved=0 failed=7 ```

This looks like ACP routing is broken even though fresh ACP launches are healthy. The warning repeats on every restart until operators manually archive stale records.

Fix: in the per-session loop, skip records where `acp.mode === "oneshot"` OR `acp.state === "closed"` BEFORE the pending-identity check. The reporter provided this exact mitigation in the issue body.

Pre-implement audit (skill v6 rules)

RuleStatusNotes
Existing-helper checkPASSNo terminal-classifier helper exists; inline 2-condition check is appropriate for the call-site
Shared-helper-caller checkPASS`reconcilePendingSessionIdentities` has one external caller (server-startup-post-attach) and the contract is unchanged — terminal sessions were never expected to be resolved
Broader-fix rival scanPASSNo open rival PR

Test plan

  • 2 new tests in `manager.test.ts`:
    • `skips startup reconcile for terminal one-shot sessions` — `mode: "oneshot"` skipped, runtime never invoked
    • `skips startup reconcile for closed sessions` — `state: "closed"` skipped, runtime never invoked
  • 112/112 pass (110 existing + 2 new) in `manager.test.ts`
  • `pnpm exec oxfmt --check` — clean
  • `pnpm exec oxlint` — 0 warnings/errors
  • CI green

Changes

file+
`CHANGELOG.md`10
`src/acp/control-plane/manager.core.ts`90
`src/acp/control-plane/manager.test.ts`820

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/acp/control-plane/manager.core.ts (modified, +8/-0)
  • src/acp/control-plane/manager.test.ts (modified, +41/-0)

Code Example

[gateway] acp startup identity reconcile (renderer=v1): checked=7 resolved=0 failed=7

---

for (const session of acpSessions) {
  if (!session.acp || !session.sessionKey) continue;
  const acpMeta = session.acp;
  if (acpMeta.mode === "oneshot" || acpMeta.state === "closed") continue;
  const currentIdentity = resolveSessionIdentityFromMeta(acpMeta);
  if (!isSessionIdentityPending(currentIdentity) || !identityHasStableSessionId(currentIdentity)) continue;
  // existing reconcile path...
}
RAW_BUFFERClick to expand / collapse

Summary

Gateway startup currently tries to reconcile persisted ACP session identities even when those records are terminal one-shot ACP sessions. If the stored identity remains pending, startup logs a scary warning like:

[gateway] acp startup identity reconcile (renderer=v1): checked=7 resolved=0 failed=7

In this case fresh ACP launches still worked for both Codex and Claude, so the warning appears to be stale terminal metadata rather than a current ACP runtime failure.

Environment

  • OpenClaw: 2026.4.24 (cbcfdf6)
  • macOS / arm64
  • Gateway mode: local loopback
  • ACP backend: acpx
  • Allowed ACP agents: codex, claude

What I observed

  1. Gateway startup repeatedly logged checked=7 resolved=0 failed=7 for ACP identity reconcile.
  2. The 7 records were persisted under the isolated codex / claude agent session stores.
  3. Each affected record had ACP metadata like:
    • mode: "oneshot"
    • identity.state: "pending"
    • an acpxRecordId
    • an acpxSessionId
  4. Some records were idle/successful one-shot smoke sessions; some were historical error sessions.
  5. Fresh smoke tests passed through both paths:
    • direct plugin-local acpx Codex and Claude one-shot prompts succeeded
    • OpenClaw ACP runtime sessions_spawn(runtime="acp") Codex and Claude one-shot prompts succeeded
  6. Newly successful one-shot ACP sessions also remained identity.state: "pending", so clearing old records alone does not solve the source behavior.

Expected behavior

Startup identity reconciliation should not try to resurrect/resolve terminal one-shot or closed ACP sessions, or should handle unresolved one-shot identity as non-fatal/noisy cleanup rather than a warning that looks like current ACP is broken.

Likely fix direction

In AcpSessionManager.reconcilePendingSessionIdentities, skip terminal records before attempting runtime re-ensure/reconcile. Local mitigation that cleared the warning:

for (const session of acpSessions) {
  if (!session.acp || !session.sessionKey) continue;
  const acpMeta = session.acp;
  if (acpMeta.mode === "oneshot" || acpMeta.state === "closed") continue;
  const currentIdentity = resolveSessionIdentityFromMeta(acpMeta);
  if (!isSessionIdentityPending(currentIdentity) || !identityHasStableSessionId(currentIdentity)) continue;
  // existing reconcile path...
}

There may be an even better source-level fix: mark successful one-shot identities as resolved before closing, or classify closed one-shot records separately. But startup should not warn as if active ACP is unhealthy when only terminal one-shot metadata is unresolved.

Why this matters

The warning makes it look like ACP/Codex/Claude agent routing is broken, even though fresh ACP sessions are healthy. It also gets repeated on every gateway restart until stale records are manually archived.

extent analysis

TL;DR

Modify the AcpSessionManager.reconcilePendingSessionIdentities function to skip terminal one-shot ACP session records.

Guidance

  • Review the AcpSessionManager.reconcilePendingSessionIdentities function to ensure it correctly handles one-shot ACP sessions with a mode of "oneshot" or a state of "closed".
  • Verify that the function skips these terminal records before attempting to reconcile their identities.
  • Consider implementing a source-level fix to mark successful one-shot identities as resolved before closing, or classify closed one-shot records separately.
  • Test the changes to ensure that the warning is no longer logged for terminal one-shot ACP sessions.

Example

The provided code snippet demonstrates how to skip terminal one-shot ACP session records:

for (const session of acpSessions) {
  if (!session.acp || !session.sessionKey) continue;
  const acpMeta = session.acp;
  if (acpMeta.mode === "oneshot" || acpMeta.state === "closed") continue;
  // existing reconcile path...
}

Notes

The current implementation may still log warnings for historical error sessions. Additional changes may be needed to handle these cases.

Recommendation

Apply the workaround by modifying the AcpSessionManager.reconcilePendingSessionIdentities function to skip terminal one-shot ACP session records, as this will prevent the warning from being logged for stale terminal metadata.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Startup identity reconciliation should not try to resurrect/resolve terminal one-shot or closed ACP sessions, or should handle unresolved one-shot identity as non-fatal/noisy cleanup rather than a warning that looks like current ACP is broken.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix ACP startup identity reconcile warns on terminal one-shot sessions [1 pull requests, 1 participants]