Skip to content

fix: keep active-turn steering across automatic auth rotation - #138516

Closed
NianJiuZst wants to merge 1 commit into
openclaw:mainfrom
NianJiuZst:codex/fix-138388-auto-profile-steering
Closed

NianJiuZst wants to merge 1 commit into
openclaw:mainfrom
NianJiuZst:codex/fix-138388-auto-profile-steering

Conversation

@NianJiuZst

Copy link
Copy Markdown
Contributor

Closes #138388

What Problem This Solves

Fixes an issue where users sending a follow-up to an active run in steer mode would have that message queued as a successor when automatic authentication rotation selected a different profile. The active turn therefore could not see the follow-up, including attached images, even though its provider, model, and tool authority were unchanged.

Why This Change Was Made

Automatic profile selection is now represented as one stable steering-authority class instead of fingerprinting the rotating profile ID. A dedicated null sentinel keeps that class distinct from having no profile, while explicit user-selected and legacy source-undefined profile IDs remain authority-significant. Provider, model, capability policy, allowlists, overrides, elevation, workspace/session scope, client capabilities, and tool bindings remain unchanged in the fingerprint.

This uses the existing auth-selection source and reply-authority owner; it adds no configuration, protocol, persistence, dependency, or fallback surface.

User Impact

Follow-ups can continue steering into the active turn when OpenClaw automatically rotates credentials for the same provider/model. Explicit profile changes and missing-profile transitions still queue rather than crossing credential boundaries.

Evidence

  • Before the fix, the new fingerprint regression failed because two automatically selected profile IDs produced different authority hashes; the run-level regression also showed zero image-injection calls and successor queuing.
  • Final head a1cbd6f360cde90c9ba3401054e549b958e54925, rebased on 9b95e87c4b2b506cc35c62e714f05cce4b71c61d.
  • node scripts/run-vitest.mjs src/auto-reply/reply/reply-run-registry.test.ts — 103 passed.
  • node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts — 173 passed after rebuilding the E2E runtime from the final head.
  • node scripts/check-changed.mjs -- src/auto-reply/reply/reply-tool-authority.ts src/auto-reply/reply/reply-run-registry.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts — passed all selected core and core-test gates.
  • Autoreview on the final branch: no actionable P0-P2 findings (correctness confidence 0.94).
  • LOC: production +3/-1; tests +80/-0.

A live channel run with two external provider credentials was not performed because it requires credentialed external side effects and a concurrent in-flight turn. The run-level E2E covers the changed owner boundary with an image-bearing steer, verifies injection, and verifies no successor enqueue.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@NianJiuZst
NianJiuZst marked this pull request as ready for review September 4, 2026 19:02
@clawsweeper clawsweeper Bot added 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 Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 23, 2026, 12:57 AM ET / 04:57 UTC (Revision 2).

ClawSweeper review

What this changes

The PR lets follow-up messages steer an active turn across automatic credential rotation while preserving distinctions for explicitly selected profiles.

Merge readiness

⛔ Blocked before merge - 2 items remain

The fix remains necessary on current main and the latest release. No introduced correctness defect was found; the outstanding production-path proof request remains unresolved.

Priority: P1
Reviewed head: a1cbd6f360cde90c9ba3401054e549b958e54925

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused repair and useful regressions are sound, but mocked evidence leaves the contributor proof gate open.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Needs real behavior proof before merge: the changed fingerprint reaches runReplyAgent in the supplied image test, but backend injection and queue admission are mocked. The captured body and discussion provide no after-fix production-runtime trace of image consumption by the original turn without a successor. No stored-data contract changes. 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 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Needs real behavior proof before merge: the changed fingerprint reaches runReplyAgent in the supplied image test, but backend injection and queue admission are mocked. The captured body and discussion provide no after-fix production-runtime trace of image consumption by the original turn without a successor. No stored-data contract changes. 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 11 items Pinned introduced change: The merge-base-to-head diff changes one fingerprint expression, its input type, and focused regressions. Automatic selection maps to null; explicit and source-undefined profiles retain their IDs.
Current main remains affected: Current main still hashes execution.authProfileId unconditionally. Its reply runner still diverts non-route-only fingerprint mismatches into the successor queue.
Latest-release check: The v2026.9.5 source also hashes the raw profile ID at line 308. GitHub identifies this release as published September 19, 2026; no shipped fix was established.
Findings None None.
Security None None.

How this fits together

The reply runner compares incoming messages with the active turn’s execution policy before injecting them or queuing another turn. Authentication selection supplies the credential provenance used in that comparison.

flowchart LR
 A[Incoming follow-up] --> C[Steering fingerprint]
 B[Credential selection and tool policy] --> C
 C --> D{Matches active turn?}
 D -->|Yes| E[Runtime injection checks]
 E --> F[Active turn receives input]
 D -->|No| G[Queue successor turn]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Needs real behavior proof before merge: the changed fingerprint reaches runReplyAgent in the supplied image test, but backend injection and queue admission are mocked. The captured body and discussion provide no after-fix production-runtime trace of image consumption by the original turn without a successor. No stored-data contract changes. 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.
  • Complete next step (P2) - Resolve the reported merge conflicts and supply the outstanding production-path proof. Redacted logs or terminal output count; screenshots or video are preferred when they show the behavior directly. Remove credentials, private endpoints, IP addresses, and personal details. Updating the PR body should trigger review; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Source +2, Tests +80. Total +82 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 2 80 0 +80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 83 1 +82

Review metrics

Metric Value Why it matters
Production versus test growth Production net +2; tests net +80 Production growth carries existing auth provenance and documents the distinction; no parallel runtime path or configuration surface is added.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #138388
Summary: This PR is the candidate repair for same-route automatic credential rotation; automatic model fallback is separate work.

Members:

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

Technical review

Best possible solution:

Keep normalization in the shared fingerprint owner, preserving explicit credential and policy boundaries; the added type member and invariant comment justify the two production lines.

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

Yes, from source: two automatically selected profile IDs produce different hashes on current main, causing an otherwise equivalent active-turn follow-up to queue. No runtime reproduction was executed in this review.

Is this the best way to solve the issue?

Yes for the code repair: the shared fingerprint owner already receives selection provenance, so normalizing there avoids bypassing downstream guards or changing credential selection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 094f165494ce.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Automatic credential rotation can prevent corrections and images from reaching an active turn under the default steering workflow.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs real behavior proof before merge: the changed fingerprint reaches runReplyAgent in the supplied image test, but backend injection and queue admission are mocked. The captured body and discussion provide no after-fix production-runtime trace of image consumption by the original turn without a successor. No stored-data contract changes. 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: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Add redacted isolated-Gateway or approved mock-gateway evidence showing automatic profile rotation, image consumption by the original turn, no successor enqueue, and continued rejection of explicit profile changes.

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 (1 earlier review cycle)
  • reviewed 2026-09-04T19:51:10.316Z sha a1cbd6f :: needs real behavior proof before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor

This fix is incorporated in merged #158699 (13747e0), including contributor credit for NianJiuZst. Current main represents automatic credential selection separately from explicit/legacy profile IDs and preserves the full route/tool/permission boundary.

I compared this PR with current main and reran the authority/fallback/followup regression group: 53 tests passed, including automatic rotation and the negative account-pin/permission cases. No remaining product behavior unique to this PR was found. Closing it as superseded by the landed implementation. Thank you for the report and focused fix.

@steipete steipete closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-rotated auth profile IDs prevent active-turn steering

3 participants