Skip to content

fix(acp): preserve configured thinking across session reuse - #128169

Merged
steipete merged 5 commits into
openclaw:mainfrom
chelsealong:fix-acp-configured-binding-thinking-128145
Aug 28, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
chelsealong:fix-acp-configured-binding-thinking-128145

Conversation

@chelsealong

@chelsealong chelsealong commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Configured live controls now apply before saving their accepted values. Codex ACP rejects unsupported live off changes explicitly, retaining the conversation and previous effort; fresh-session off continues to omit the startup override. This behavior was explicitly approved by the maintainer and verified with paired real native Codex sessions. The final Ollama sibling trace, all 255 isolated ACPX tests, and exact-head CI also pass.

Configured ACP agents now carry their thinking policy alongside their model, both when creating a bound session and when updating an existing conversation. ACP spawning also honors a configured target agent's thinkingDefault after explicit/subagent overrides.

Fixes #128145. Consolidates the configured-binding work in #129260 into this PR; thanks @chelsealong and @ayeshafayyaz-pixel.

What Problem This Solves

The configured-binding producer and record carried model, backend, and cwd but omitted thinking. The lifecycle consequently never applied a configured thinking value. ACP spawning had the adjacent mismatch: it inherited the configured agent's model but skipped that agent's thinking default.

The canonical flow now resolves configured thinking at the binding producer (agent, then per-model policy, then global), carries it through the binding record, and reuses one explicit model/thinking projection for initialization and in-place reconciliation. Unconfigured external-harness defaults remain external-harness owned. A redundant spec-copy helper and the custom model-ref parser are removed in favor of the typed materialization and existing parser/resolver.

Removing the last configured value preserves the current session selection in both metadata and the backend. This follows the existing configured-model contract from #120046; it does not introduce an unset operation or reset a conversation. If removing an agent default reveals a remaining per-model/global policy, that concrete replacement is applied normally.

Ready-session updates reuse the manager's existing checked config-option command instead of metadata-only updates. Each model/thinking value is persisted only after backend acceptance. Rejection returns a visible error without marking the session broken or triggering recreation on the next admission. Model is applied before thinking; these are independent operations, not an atomic batch.

Review findings and scope

  • Addressed the live-unset finding by removing the misleading thinking: undefined update, not by discarding conversation history. ACPX 0.13.1 exposes string-valued config writes, not generic unset; ordinary close also preserves its desired settings.
  • Addressed the already-ready-session gap from fix(acp): honor agent thinkingDefault for ACP bindings instead of forcing adaptive #129260 through the shared in-place reconciliation path.
  • No new config keys, environment variables, dependency changes, SQLite schema changes, or protocol changes. The added binding metadata field carries existing configuration through the existing record shape; this is not an embedding/vector storage change.
  • Addressed the Codex live-off finding at the plugin-owned adapter boundary: unsupported clearing is an error, not an acknowledged no-op. The configured lifecycle now uses apply-before-persist semantics, while startup omission remains supported.
  • Production LOC: +37/-45 (net -8). Tests: +429/-51. Docs: +19/-1.
  • Provenance: fix(acp): pass configured agent model to ACP binding sessions #120046 (authored and merged by @steipete on 2026-08-06) carried forward the thinking omission while adding configured-model propagation. The ACP spawn model inheritance predates this PR in commit 9ead0ae9219e87ba2c223ada385f380fea9415cc; its code author was Peter Steinberger. These identify the incomplete owner boundary, not an assertion that this PR introduced the original defect.

Evidence

  • Red-before proof: current-main configured-binding producer drops all three tested configured thinking policies; the incoming PR fails session-selection preservation; ACP spawn fails owner-off precedence and model-less owner-off propagation.
  • Additional red-before proof against ab915c0: all three live Codex effort aliases acknowledge off instead of rejecting it, and the real lifecycle/manager boundary accepts a rejected configured value. After repair, 136 focused tests pass, including fresh off, accepted high, repeated rejected off, omission, unchanged accepted metadata, and conversation reuse.
  • Focused suite: 103 tests passed across configured-binding resolution, lifecycle, and ACP spawning, including record round-trip, per-model aliases, absent policy, existing-session updates, omission, explicit/subagent precedence, and harness defaults.
  • Post-refresh broader suite: 282 tests passed across 20 files and six Vitest shards, including the ACP control plane, persistent bindings, channel binding/driver surfaces, and ACP spawning.
  • Independent Codex review: no findings at the configured reporting threshold on the original branch, the live-off repair, and the final test-only follow-up. Manual owner-boundary review and regression proof also addressed the prior P1 findings. Dependency inspection covered ACPX's successful-set persistence, ordinary-close preservation, and config-option contract, plus Codex sparse model/effort settings ownership.
  • Original full changed checks passed at ab915c0, including core/plugin type checks, tests type checks, lint, import cycles, dependency/boundary guards, and state guards. The final full changed-check run also passed, including the storage, sidecar, webhook, and pairing guards. Its initial file plan preceded the test-only move; the new focused file separately passed the ACP-owning test type shard and lint, and final exact-head CI covers the full resulting tree.
  • Final-head test-only cleanup: 124 focused manager/configured-binding/plugin tests passed; the ACP-owning test type shard and focused lint passed. The first CI attempt caught a test-file line limit and a table-union type error; both were repaired without production changes in 20eb662338b51c1c40d2c530953b82e559e4e439. Final exact-head CI passed, including the required gate and build artifacts. The separate OpenGrep scan passed on retry: its first attempt failed to fetch the base commit before any scan ran; the second fetched it and completed the scan and SARIF upload successfully, with no source change.
  • The broader local sweep passed 527 of 530 tests; three unchanged Pi catalog tests timed out during cold module loading. A complete local ACPX rerun reproduced those same three timeouts (252/255 passed). These runs are not counted as green. The exact-final-source isolated Linux whole-plugin rerun passed 255 tests across 22 files in 28.64 seconds; all three affected Pi tests completed in 16.7–17.6 seconds under their unchanged 120-second deadlines. Provider credentials were removed before this run. The environment comparison supports local contention as the cause; no timeout, assertion, or production workaround was added.
  • Exact-head CI passed at ab915c0e30dd02f9ef9bde426ac8f2425964306e, including build-artifacts and required openclaw/ci-gate. An earlier PR-context check rejected the heading names; the required problem/evidence headings are now present and the checks are green.
  • Direct Codex contract inspection was completed by the acting maintainer agent at d47e5cc0e2bbd35774dff15c83570519735d2ac4: sparse model/effort settings and queued-versus-applied settings. The automated review's missing sibling checkout is not a remaining inspection gap.

Live configured-binding trace

Completed an isolated, authenticated real-provider comparison: managed Gateway with normal signed-device authentication and real config.set hot reloads; actual configured-binding consumer → serialized record → lifecycle admission; public chat.send → real ACPX stdio → OpenClaw ACP bridge → ollama-cloud/glm-5.2:cloud. No manager/backend/provider mocks. This is owner-boundary integration, not Slack transport E2E or live model-switch proof.

Both versions received the same three-step scenario: configure owner thinking off, change it to high, then remove it entirely. Each step made a real provider turn. Later prompts asked for a randomized fictional sentence from the first turn without resending it. The final paired runs both exited 0; the baseline verdict deliberately asserts the known regression, while the candidate asserts the repair.

{
  "baseline": {
    "source": "801cbbd665ef73027f1fc0e7ac52be1dc8cfe280",
    "configuredThinking": ["off", "high", null],
    "bindingSpecThinking": [null, null, null],
    "innerSessionThinking": [null, null, null],
    "acpxCurrentThoughtLevel": ["adaptive", "adaptive", "adaptive"],
    "acpxDesiredThoughtLevel": [null, null, null],
    "completedProviderTurns": 3,
    "innerOuterAndBackendSessionIdsStable": true,
    "historyRecallPreserved": true,
    "expectedRegressionReproduced": true
  },
  "candidate": {
    "source": "ab915c0e30dd02f9ef9bde426ac8f2425964306e",
    "configuredThinking": ["off", "high", null],
    "bindingSpecThinking": ["off", "high", null],
    "innerSessionThinking": ["off", "high", "high"],
    "acpxCurrentThoughtLevel": ["off", "high", "high"],
    "acpxDesiredThoughtLevel": ["off", "high", "high"],
    "completedProviderTurns": 3,
    "innerOuterAndBackendSessionIdsStable": true,
    "historyRecallPreserved": true,
    "repairVerified": true
  }
}

Provenance: all eight candidate source files matched their exact ab915c0 Git blobs after transport; patch SHA-256 4ae7008ecb6e8f51595b41b746e33c65e5cd7c3ba75ac888b59776c366145bac. The live process source-loaded the changed owners with the unchanged trusted-baseline built plugin/child runtime; candidate build coverage comes separately from exact-head CI. The identical final proof script had SHA-256 29ae1ca452ddc021a2ee9c44ee3f0ae26d28469b4bcb793c49ee0ffde0208146 and was invoked with node --import tsx gateway-proof.mjs in each isolated source copy.

One earlier fixture attempt failed its expected-reply marker because the model mistook a UUID-shaped test phrase for a credential. Canonical transcript evidence showed a normal completed high-thinking reply in approximately ten seconds, not a provider timeout. Replaced only the synthetic recall content with an ordinary fictional sentence and made terminal marker failures immediate; reran both versions with unchanged settings/history assertions and unchanged deadlines.

This trace addresses the earlier ClawSweeper configured-binding next-turn/session-state proof request. The binding field is ordinary existing metadata, not vector/embedding storage or a schema migration. The final candidate additionally changes the checked live-control path; its Codex proof is recorded separately below.

Codex explicit-off repair

The final candidate additionally repeated the supported-control Ollama scenario with its fully rebuilt ACPX plugin and canonical active Gateway config. All three real provider turns passed: inner session thinking, current backend option, and desired option were each off → high → high; outer, inner, and backend session IDs stayed stable, and later replies recalled the first turn's fictional sentence. Final script SHA-256 948e0fe874242fcedc3165ab8e0cb72cc7a0e0a4820dabb4201d11c69ba1ed2c. The fixture uses the documented --token-file with an isolated generated Gateway token; an earlier missing-token handshake failed before any provider turn and is not counted as proof. The inner model is explicitly configured as reasoning-capable; this does not verify or change published model-catalog reasoning metadata. Both Codex and Ollama final phases use candidate 5c8f87f, whose production/docs are byte-identical to final test-only head 20eb662.

The subsequent ClawSweeper review correctly identified an uncovered Codex transition: extensions/acpx/src/runtime.ts mapped off to no effort and returned before delegate I/O, so an existing high selection was not cleared. The Ollama trace above does not establish Codex live-clear behavior.

Direct source inspection confirms the constraint: pinned @agentclientprotocol/[email protected] accepts only advertised string-valued reasoning efforts, not null/default/off. Codex turn/start maps its optional effort to a supplied update; null/omission preserves the current setting, despite an internal nullable update type. The adapter's legacy bare-model operation can select the model default, but that is neither the original startup policy nor a generic clear exposed through the current ACPX delegate. Native none is valid only for models advertising it and is not equivalent to the shipped OpenClaw off contract.

Stable OpenClaw v2026.7.1-2 already omits the Codex startup override for off. The approved repair preserves that startup contract and returns ACP_BACKEND_UNSUPPORTED_CONTROL for live clearing. It does not map off to native none, reset the conversation, or claim metadata-only success. A separately defined upstream reset contract remains out of scope.

Paired native Codex final-effect proof

Both phases completed successfully on isolated Linux: baseline ab915c0 and candidate 5c8f87f (production/docs byte-identical to final head 20eb662). Each source copy received a full build, including its actual ACPX plugin, and used real codex-cli 0.149.1 with @agentclientprotocol/[email protected], public model openai/gpt-5.6-sol, normal signed Gateway authentication, public chat.send, actual configured-binding admission, and real config reloads. A passive allowlisted native-protocol tap recorded actual turn/start efforts and matching completed turns, not just OpenClaw metadata. Native startup default was deliberately set to medium in the test harness; this is not a claim about the model's catalog default.

Observation Baseline Candidate
First real turn high high
Explicit live off reply Acknowledged success; metadata becomes off Visible ACP_BACKEND_UNSUPPORTED_CONTROL; metadata remains high
Next real turn Still high despite the acknowledgment high, matching the retained accepted state
Configured off, including repeated admission Accepted Both attempts visibly rejected; accepted metadata/backend effort remain high
Omit policy, then real history-recall turn medium after actual config reload high
Separate fresh configured off session Usable; actual controlled default medium Usable; actual controlled default medium
Completed native provider turns 4 4
Existing conversation IDs and recalled history Preserved Preserved

The baseline's warm explicit control is the reproduced no-op. Its later genuine config reload can resume the same thread with the controlled startup default, so the proof does not claim that every reinitialization retains high. The candidate retains accepted high across both rejected controls and reloads. Both phases used identical final harness SHA-256 711f287ac04629464927c3196bb9b5b8f572e7ca28e11536d68a222198b15e45 and passive tap SHA-256 1a614ed7b8fb07319bab6f4b1590e98e8886c047250d1ea888cdb0839ab28226; candidate behavior patch SHA-256 93fe08a70f87f31bfee103445e383122cccd85b586a7816764c89791453de054. The acting maintainer agent inspected the actual structured state, error replies, stable IDs, native requests/completions, and history replies.

Earlier fixture failures were corrected, not counted as proof: cold source initialization preceded the client connection to avoid an idle client watchdog; the model was changed to an advertised public model with actual effort controls; and observation was made passive using the canonical active config object. Passing a separate raw config object to a status call had inadvertently reinitialized the runtime and changed what was being measured. Both baseline and candidate were rerun with the identical corrected harness; no production timeout, assertion, or reset workaround was added.

The latest ClawSweeper rank-up moves are addressed: the maintainer selected the visible-error contract, the real manager/lifecycle regression covers acceptance and rejection, and this trace establishes final effects on an existing Codex session. Direct acting-agent dependency inspection also includes pinned Codex rust-v0.149.1 (ff29a44391deccde0aba0f8390337d7f3c319ea4), codex-rs/app-server/src/request_processors/turn_processor.rs:535-549, plus the current sparse-setting boundary linked above. This remains owner-boundary/provider proof, not Slack transport E2E or cross-model normalization proof.

Live cleanup was verified before the clean-machine test sweep: all seven task-owned state directories removed, no owned Gateway/ACP/Codex children remaining, all seven Gateway ports closed, and no provider credentials forwarded to tests. After the suite passed, the owned isolated lease was verified released and the task secret window removed. No operator state was touched.

Known separate follow-up

Named follow-up: Hidden native models lack ACP effort controls. Pinned Codex can run a configured public model omitted from its default model/list, while the ACP adapter synthesizes a model choice without corresponding effort controls. The initial gpt-5.4 fixture completed a real high-effort turn but exposed no effort option; pinned catalog visibility and adapter model-list handling explain the mismatch. This is a separate catalog/control-availability boundary. Final proof uses the advertised public model above and does not claim to fix hidden-model control discovery.

Named follow-up: Model changes need pairwise model/effort acceptance ownership. Codex ACP can retain the old effort when supported by the new model or select the new model's default otherwise ([email protected], applyModelChange). The existing generic model setter persists only the requested model and retains thinking metadata; automatic next-turn thinking rejection is optional. Thus an unchanged configured effort can disagree with the new model's effective effort. Merely rechecking thinking on the first model-change admission is insufficient: after that rejection, the accepted model is already stored, so a retry can skip both matching values. This also affects the existing manual model-control owner and needs a separately defined effective-settings/acceptance contract, not a metadata-only guard, a Codex-specific off exception in core, or an assertion of atomic batch behavior. This PR's paired live proof keeps the model fixed and does not claim to repair cross-model effort normalization.

/acp reset-options currently closes the runtime normally and deletes OpenClaw option metadata; ACPX ordinary close preserves its own desired settings. A generic non-destructive backend-default reset needs a separate explicit contract. This PR does not recommend that command as a proven backend reset and does not add destructive reset behavior.

The report's explicit runtime mode auto is a separate control from configured thinking. The OpenClaw ACP bridge maps it to adaptive thinking, which can legitimately be rejected by an incompatible model; forwarding an owner default does not make unsupported explicit modes valid.

The paired live runs separately exercised /acp set-mode auto: both returned a visible unsupported-adaptive error. The candidate retained its accepted high setting after that rejection. This is not claimed as repaired by configured-default forwarding.

Named follow-up: ACP chat.send duplicates canonical transcript turns because reply_dispatch does not communicate transcript ownership. Both baseline and candidate canonical transcripts showed two outer user/assistant copies but one inner copy for each of the three provider turns. Source inspection finds both producers already on the trusted baseline: ACP dispatch persists the pair, then Gateway's non-agent finalizer persists it again with different idempotency ownership. The correct follow-up is the dispatch/recorder ownership handoff, not text-based storage deduplication or pretending a native agent run started. This independent path is unchanged by this PR.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 27, 2026, 9:06 PM ET / August 28, 2026, 01:06 UTC.

ClawSweeper review

What this changes

The PR forwards configured agent thinking policy into ACP binding records, initializes or reconciles reused ACP sessions with it, and rejects unsupported live Codex off changes without overwriting accepted session state.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

Keep open: the core repair is source-supported, but the final head’s Codex live-off rejection path has no observed current-head proof, and the required direct Codex source inspection was unavailable.

Priority: P1
Reviewed head: 20eb662338b51c1c40d2c530953b82e559e4e439

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source repair and focused regressions are strong, but the final Codex-specific behavior remains unproven in a real session and its upstream contract was unavailable for direct inspection.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The supplied terminal trace proves an earlier Ollama candidate, but the current head adds the Codex live-off rejection path and the PR states its paired Codex proof is still in progress; post redacted runtime evidence is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The supplied terminal trace proves an earlier Ollama candidate, but the current head adds the Codex live-off rejection path and the PR states its paired Codex proof is still in progress; post redacted runtime evidence is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main omission: Current main materializes the configured binding with the owner model but has no thinking-policy calculation or record field, so the reported configured-thinking path remains absent there.
Producer and lifecycle repair: The PR computes configured thinking at the binding producer, serializes it, and uses the manager’s checked config-option command for ready-session reconciliation.
Apply-before-persist owner boundary: The ACP manager sends the live config option before merging and persisting the inferred runtime option, so a rejected direct update cannot overwrite accepted metadata.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/acp/control-plane/manager.configured-bindings.test.ts extensions/acpx/src/runtime.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.acp.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-128169-o7vx7a/target

 ✓  acp  src/acp/control-plane/manager.configured-bindings.test.ts (1 test) 48ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  01:06:55
   Duration  8.93s (transform 7.02s, setup 997ms, import 7.51s, tests 48ms, environment 0ms)

[test] starting test/vitest/vitest.extension-acpx.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-128169-o7vx7a/target

 ✓  extension-acpx  extensions/acpx/src/runtime.test.ts (102 tests) 506ms
     ✓ coalesces repeated probe uncertainty before it can evict a live lease  310ms

 Test Files  1 passed (1)
      Tests  102 passed (102)
   Start at  01:07:04
   Duration  4.24s (transform 2.78s, setup 1.00s, import 2.36s, tests 506ms, environment 0ms)

[test] passed 2 Vitest shards in 20.45s


























Assertions:

  • PASS expect_output: Test Files

How this fits together

Configured channel bindings select an OpenClaw agent and materialize an ACP session record. The selected model and thinking policy then flow through the ACP manager to the external harness before the next agent turn.

flowchart LR
  A[Channel conversation] --> B[Configured ACP binding]
  B --> C[Agent model and thinking policy]
  C --> D[Binding session record]
  D --> E[ACP session manager]
  E --> F[ACP runtime adapter]
  F --> G[External harness turn]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The supplied terminal trace proves an earlier Ollama candidate, but the current head adds the Codex live-off rejection path and the PR states its paired Codex proof is still in progress; post redacted runtime evidence is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Existing configured ACP sessions will now receive model/thinking reconciliation rather than retaining prior harness state; unsupported live controls can therefore block the next configured turn, so exact-head behavior needs confirmation.
  • Resolve merge risk (P1) - The changed Codex adapter contract could not be inspected directly because the required sibling source checkout is absent and network access was unavailable.
  • Complete next step (P2) - Hold normal merge review for the exact-head Codex runtime proof and the direct dependency-contract check; no bounded repair task is identified.
Agent review details

Security

None.

PR surface

Source -8, Tests +378, Docs +18. Total +388 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 37 45 -8
Tests 5 429 51 +378
Docs 1 19 1 +18
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 485 97 +388

Review metrics

Metric Value Why it matters
Production versus test delta production +37/-45 (net -8); tests +429/-51; docs +19/-1 The implementation is net-negative, while the added tests cover the new producer, lifecycle, and adapter decision surfaces.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/acp/persistent-bindings.types.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128145
Summary: This PR is the active candidate fix for the configured ACP thinking-default failure; a second open PR addresses the same central omission but is not a safer replacement.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Capture exact-head Codex transition proof (recommended)
    Before merge, provide a redacted real Codex ACP trace showing a reused high-effort session rejects configured off while retaining the same conversation and accepted metadata.
  2. Pause for direct contract verification
    Hold this PR until a reviewer can inspect the matching Codex runtime source and confirm that no live unset control exists.

Technical review

Best possible solution:

Land only after an exact-head real Codex ACP session demonstrates high-to-off rejection before metadata persistence, preserves the conversation and accepted high setting, and is paired with direct Codex runtime-contract inspection.

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

Yes, by source: current main materializes configured ACP bindings without a thinking value, while the PR’s producer and lifecycle path carry it through to session initialization. This review did not execute the external-harness reproduction.

Is this the best way to solve the issue?

Mostly yes: carrying policy at the configured-binding producer and applying accepted live controls through the manager is the narrow owner-boundary repair. Final confidence depends on proving the new Codex rejection behavior against its actual runtime contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f40f90727c8b.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.

Label justifications:

  • P1: Affected configured ACP runs can fail before an agent turn when an incompatible harness thinking default is used.
  • merge-risk: 🚨 compatibility: The PR changes how existing configured agent defaults are applied to already-created ACP sessions.
  • merge-risk: 🚨 session-state: The changed reconciliation path deliberately preserves conversation identity and accepted runtime metadata across reused sessions.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Needs stronger real behavior proof before merge: The supplied terminal trace proves an earlier Ollama candidate, but the current head adds the Codex live-off rejection path and the PR states its paired Codex proof is still in progress; post redacted runtime evidence is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged configured-model predecessor and the final ACP consolidation and live-control commits on this branch. (role: recent ACP feature owner; confidence: high; commits: d0fe7bcb3caf, ab915c0e30dd, 5c8f87f2c963; files: src/acp/persistent-bindings.lifecycle.ts, src/channels/plugins/acp-configured-binding-consumer.ts, extensions/acpx/src/runtime.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Publish a redacted exact-head Codex ACP high-to-off trace that shows the visible error, stable conversation, and unchanged accepted metadata.
  • Make the matching Codex source available for direct runtime-contract inspection before relying on this review for merge approval.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (8 earlier review cycles)
  • reviewed 2026-08-23T09:44:11.404Z sha 382cfc10d0118e52a01b82024bae2a2914ad9739 :: needs real behavior proof before merge. :: [P1] Honor per-model thinking before the global default | [P1] Clear or rebuild ACP thinking when the configured default is removed
  • reviewed 2026-08-23T10:40:00.926Z sha 55e8b81c8b07fde29b2d677118a1e496418cd405 :: needs real behavior proof before merge. :: [P1] Reset the live handle when unsetting thinking
  • reviewed 2026-08-24T14:22:39.064Z sha 55e8b81c8b07fde29b2d677118a1e496418cd405 :: needs real behavior proof before merge. :: [P1] Reset the live ACP handle when unsetting thinking
  • reviewed 2026-08-25T15:56:57.213Z sha 55e8b81c8b07fde29b2d677118a1e496418cd405 :: needs real behavior proof before merge. :: [P1] Reset the live ACP handle when unsetting thinking
  • reviewed 2026-08-27T02:11:27.202Z sha ab915c0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T02:26:59.475Z sha ab915c0 :: needs real behavior proof before merge. :: [P1] Handle existing Codex sessions when thinking becomes off
  • reviewed 2026-08-27T02:52:57.836Z sha ab915c0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T03:35:59.695Z sha ab915c0 :: found issues before merge. :: [P1] Reject unsupported Codex off reconciliation

@chelsealong

Copy link
Copy Markdown
Contributor Author

Addressed both P1 findings:

  • src/channels/plugins/acp-configured-binding-consumer.ts: resolveConfiguredBindingThinking now checks per-agent thinkingDefault first, then reuses the canonical resolveConfiguredThinkingDefaultCore (same helper model-selection.ts uses) so agents.defaults.models[provider/model].params.thinking outranks the global default, instead of being skipped.
  • src/acp/persistent-bindings.lifecycle.ts: the live-session reconciliation patch no longer requires spec.thinking to be truthy — it now compares desired vs. current and patches (including to undefined) whenever they differ, so removing an agent/global thinking default clears a previously pinned session value instead of leaving it stuck.

Added regression coverage for both (fails without the fix): src/channels/plugins/acp-configured-binding-consumer.test.ts (per-model precedence) and a new case in src/acp/persistent-bindings.lifecycle.test.ts (explicit-to-unset reconciliation). Full suite: pnpm test -- src/acp/persistent-bindings.lifecycle.test.ts src/channels/plugins — 60 files / 573 tests passed. tsgo:core and oxfmt --check clean on touched files.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 23, 2026
@chelsealong

Copy link
Copy Markdown
Contributor Author

Confirmed the new P1 by reading the actual boundary: updateSessionRuntimeOptions (src/acp/control-plane/manager.core.ts:269) routes to runUpdateManagerSessionRuntimeOptions (manager.runtime-options-commands.ts:146), which only persists via mergeRuntimeOptions/persistManagerRuntimeOptions — no session/set_config_option call. And normalizeRuntimeOptions (runtime-options.ts:269) drops a falsy/undefined thinking from the merged object entirely, so once the explicit-to-unset patch lands, the persisted options simply have no thinking key — nothing downstream ever builds a clear pair for the cached backend. The finding is correct: the unset path only fixes app-side bookkeeping, not the live ACP session.

I'm not making a code change on this pass. This PR is already at +173 added lines against this task's 120-line size cap (git diff 3cb52f4bb86..HEAD | grep -c "^+[^+]"), before any further edit. A real fix — either a verified ACP clear control or forcing session recreation on unset — is additional production code that would push further over that cap, and the review's own P2 already flags that a maintainer needs to choose the safe behavior (live clear vs. dropping the claimed live-unset reconciliation and keeping only the proven initial-forwarding fix) before a narrow repair can land. Leaving that decision and any further diff to a maintainer/follow-up rather than adding more code here.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 25, 2026
@steipete steipete self-assigned this Aug 27, 2026
chelsealong and others added 3 commits August 26, 2026 19:02
…ings

Configured channel-to-ACP bindings only forwarded the owner agent's
model into the ACP session's runtime options, so the agent's
thinkingDefault (e.g. "off") never reached the ACP session. The
underlying backend then applied its own default thinking level, which
some models reject outright (e.g. ollama-cloud/glm-5.2:cloud rejects
"adaptive"), breaking configured/swarm ACP runs with no workaround.

Resolve the owner agent's effective thinking default (per-agent
thinkingDefault, falling back to agents.defaults.thinkingDefault, per
docs/tools/thinking.md) alongside its model, persist it on the
binding spec/record, and forward it through session init and the
existing live model-drift patch path.
Reuses the canonical resolveConfiguredThinkingDefaultCore helper so a
configured ACP binding's thinking default respects
agents.defaults.models[key].params.thinking ahead of the global
default, matching normal reply resolution. Also reconciles the
explicit-to-unset transition: removing an agent/global thinking
default now clears a previously pinned value on a live session
instead of leaving it stuck.
Consolidate configured model/thinking reconciliation without clearing backend state or replacing conversations. Honor target-agent thinking defaults during ACP spawn and document precedence and omission.

Co-authored-by: chelsealong <[email protected]>

Co-authored-by: ayeshafayyaz-pixel <[email protected]>
@steipete
steipete force-pushed the fix-acp-configured-binding-thinking-128145 branch from 55e8b81 to ab915c0 Compare August 27, 2026 02:04
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M and removed size: S labels Aug 27, 2026
@steipete steipete changed the title fix(acp): forward owner agent thinking default to configured ACP bindings fix(acp): preserve configured thinking across session reuse Aug 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 27, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The canonical repair at ab915c0e30dd02f9ef9bde426ac8f2425964306e consolidates #129260 and addresses the previous rank-up moves:

  • Removed metadata-only unset behavior. Complete configuration omission now retains the existing selection in metadata and the backend, matching the established configured-model contract; it does not recreate the conversation. A concrete remaining per-model/global policy is still applied.
  • One model/thinking projection now covers both initialization and already-ready session reconciliation. Owner thinking also reaches ACP spawn after explicit/subagent overrides.
  • Reused the existing configured-thinking resolver/model parser and removed the spec-copy helper. Production delta is net -5 lines; no new config, schema, or dependency surface.
  • Added red-before regressions and passed 282 broader ACP/binding/channel/spawn tests plus the full changed-check gate. Final independent Codex review reported no P0 findings.

Exact-head CI and the complete live Gateway/ACP/Ollama update-and-history comparison are still running; landing remains gated on those results. The PR body records the separate existing reset-options and explicit-auto-mode limitations rather than presenting either as fixed.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 27, 2026
@clawsweeper clawsweeper Bot added the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Aug 27, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 27, 2026
steipete and others added 2 commits August 27, 2026 17:41
Apply configured live controls through the existing checked manager path.
Keep accepted settings and conversation state when a control is rejected,
and distinguish Codex startup omission from unsupported live effort clearing.

Co-authored-by: chelsealong <[email protected]>
Co-authored-by: ayeshafayyaz-pixel <[email protected]>
Keep the real manager/lifecycle regression in a focused test file and narrow
the adapter case union explicitly. Runtime behavior is unchanged.

Co-authored-by: chelsealong <[email protected]>
Co-authored-by: ayeshafayyaz-pixel <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The maintainer selected the recommended visible unsupported-live-clear error. Final head 20eb662338b51c1c40d2c530953b82e559e4e439 applies supported configured controls before persisting them and rejects Codex live off without changing accepted metadata or discarding the conversation.

The PR body now includes paired real native Codex proof: four completed provider turns per phase, passive native effort receipts, stable session IDs, history recall, repeated configured rejection, and usable fresh off. Baseline warm explicit off falsely acknowledges success while the next turn remains high; candidate returns the error and truthfully retains high. Both rank-up moves and the missing direct Codex inspection are addressed. Final CI and the final Ollama/whole-plugin sibling rerun remain in progress; no merge has been attempted.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

The refreshed review at 2026-08-28 01:06 UTC has no actionable code findings. Its remaining proof/contract requests are now addressed in the updated PR body:

  • Paired real native Codex runs completed four provider turns each. The baseline falsely acknowledges warm live off; the candidate returns ACP_BACKEND_UNSUPPORTED_CONTROL for explicit and repeated configured off, retains accepted metadata and actual high, and preserves conversation IDs and recalled history. Fresh configured off remains usable. Actual native turn/start and completion receipts are summarized in the proof table.
  • Live candidate 5c8f87f was fully built, including its plugin. Final head 20eb662 changes only test organization/type narrowing; production and docs are byte-identical, verified against Git blobs. Final-source ACPX coverage is 255/255, exact-head CI and OpenGrep are green, and the full local changed-check gate passed.
  • The acting maintainer agent personally inspected the sibling Codex checkout, including external effort mapping, internal sparse settings, and the matching 0.149.1 turn processor, plus installed codex-acp 1.6.0 source. The review worker's unavailable checkout is not being treated as dependency proof.

Both current rank-up moves are satisfied. The final Ollama trace also passed off → high → omitted as actual off → high → high. All test credentials, owned processes/ports, and the isolated lease are cleaned up. Native preparation passed on 20eb662; proceeding with the authorized native landing workflow.

@steipete
steipete merged commit 8d8736d into openclaw:main Aug 28, 2026
274 of 276 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
…#128169)

* fix(acp): forward owner agent thinking default to configured ACP bindings

Configured channel-to-ACP bindings only forwarded the owner agent's
model into the ACP session's runtime options, so the agent's
thinkingDefault (e.g. "off") never reached the ACP session. The
underlying backend then applied its own default thinking level, which
some models reject outright (e.g. ollama-cloud/glm-5.2:cloud rejects
"adaptive"), breaking configured/swarm ACP runs with no workaround.

Resolve the owner agent's effective thinking default (per-agent
thinkingDefault, falling back to agents.defaults.thinkingDefault, per
docs/tools/thinking.md) alongside its model, persist it on the
binding spec/record, and forward it through session init and the
existing live model-drift patch path.

* fix(acp): honor per-model thinking policy and reconcile removed defaults

Reuses the canonical resolveConfiguredThinkingDefaultCore helper so a
configured ACP binding's thinking default respects
agents.defaults.models[key].params.thinking ahead of the global
default, matching normal reply resolution. Also reconciles the
explicit-to-unset transition: removing an agent/global thinking
default now clears a previously pinned value on a live session
instead of leaving it stuck.

* fix(acp): preserve configured thinking across session reuse

Consolidate configured model/thinking reconciliation without clearing backend state or replacing conversations. Honor target-agent thinking defaults during ACP spawn and document precedence and omission.

Co-authored-by: chelsealong <[email protected]>

Co-authored-by: ayeshafayyaz-pixel <[email protected]>

* fix(acp): reject unsupported live effort before persisting

Apply configured live controls through the existing checked manager path.
Keep accepted settings and conversation state when a control is rejected,
and distinguish Codex startup omission from unsupported live effort clearing.

Co-authored-by: chelsealong <[email protected]>
Co-authored-by: ayeshafayyaz-pixel <[email protected]>

* test(acp): isolate configured binding regression coverage

Keep the real manager/lifecycle regression in a focused test file and narrow
the adapter case union explicitly. Runtime behavior is unchanged.

Co-authored-by: chelsealong <[email protected]>
Co-authored-by: ayeshafayyaz-pixel <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: ayeshafayyaz-pixel <[email protected]>
MasterSwords1 added a commit to MasterSwords1/openclaw that referenced this pull request Aug 29, 2026
… thinkingDefault over ACP

- Add the OpenClaw-only `adaptive` thinking tier to Ollama's reasoning
  profile (maps to native `think: "high"` via normalizeOllamaThinkValue).
- ACP session presentation now falls back to the configured
  `thinkingDefault` when no explicit `thinkingLevel` is set, instead of
  forcing "adaptive".
- Add ACP presentation tests (honors thinkingDefault; explicit level wins)
  and an Ollama Cloud live proof (gpt-oss:20b accepts think:"high").

Scope narrowed from the previous revision: the earlier /acp spawn additions
were incomplete (did not compile) and overlap the already-merged bridge
thinkingDefault handling in openclaw#128169, so they are dropped here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: acpx merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

acpx: thinkingLevel 'adaptive' default breaks ACP runs with ollama-cloud models

2 participants