Repository navigation
fix(cron): forward CLI auth profiles to isolated runs - #144221
harshitgupta31415 wants to merge 3 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 10, 2026, 3:23 PM ET / 19:23 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR forwards backend-compatible authentication profiles to isolated cron attempts and treats unspecified selection provenance as automatic. Merge readiness⛔ Blocked before merge - 4 items remain This remains a useful fix for an omission present on main and in v2026.9.3. The earlier candidate-selection finding is resolved; the new process fixture improves propagation coverage but does not satisfy the outstanding credential-boundary proof requirement. Priority: P1 Review scores
Verification
How this fits togetherCron executes scheduled agent prompts through model fallback candidates. For CLI-backed candidates, OpenClaw selects an authentication profile before the backend prepares credentials and starts its process. flowchart TD
A[Scheduled agent prompt] --> B[Model fallback candidate]
C[Selected profile and auth store] --> D[CLI auth resolver]
B --> D
D --> E{Compatible identity?}
E -->|Managed profile or native login| F[CLI backend preparation]
E -->|Invalid explicit profile| G[Reject attempt]
F --> H[CLI process and response]
Before merge
Findings
Agent review detailsSecurityNeeds attention: No concrete exploit or supply-chain change was established, but the new credential handoff still needs final-effect authority proof. PR surfaceSource +17, Tests +247. Total +264 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use the shared candidate-auth owner for cron while preserving native login and proving that invalidated identities cannot reach credential delivery or reuse another account's CLI history. Do we have a high-confidence way to reproduce the issue? Yes, at source level: main omits the CLI auth profile, and the report supplies repeatable headless cron steps with a valid managed token. This review did not execute those steps. Is this the best way to solve the issue? Yes, reusing the existing candidate-auth resolver is the appropriate repair boundary; the supplied fixture is not sufficient validation of the resulting credential handoff. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 87f646243c44. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@openclaw/openclaw-secops please review the auth-boundary evidence for this draft PR. Current head: The focused cron test now executes the production cron path, captures the candidate-owned No live Claude credential or provider endpoint is available locally, so live provider E2E and in-flight account reassignment proof are explicitly not claimed. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Fixes #144047
Reporter: @angeliti999
What Problem This Solves
Scheduled cron runs using a CLI-backed model lost the auth profile selected during cron preparation. The initial profile could be forwarded unchanged to a fallback CLI candidate, allowing the wrong credential owner to reach the backend or causing a valid managed run to fall back to native login.
Why This Change Was Made
The cron executor now resolves CLI auth at each candidate's execution-provider boundary through the existing
resolveCliExecutionAuthProfileIdowner. Candidate-owned CLI profiles may be forwarded; automatic canonical Anthropic selections preserve native Claude login; automatic cross-provider profiles are not carried into Claude CLI; explicit incompatible or missing profiles fail closed. Missing auth-selection provenance is normalized to automatic, matching the resolver contract and the candidate pattern referenced by #144266.User Impact
CLI-backed cron jobs keep their selected managed profile when the selected CLI backend owns it. Fallback candidates cannot inherit an unrelated automatic credential, and explicit account mismatches stop before execution. No configuration, dependency, or public API surface changes.
Evidence
0f68d696c3cc9c93bb45048f8c72036e577490de: the focused cron regression failed becauserunCliAgentreceived noauthProfileId(2 passed, 1 failed).8d8b48c2421c1703fea14551671aa7b0a25d34d0.node_modules\\.bin\\vitest.cmd run --config test/vitest/vitest.cron.config.ts src/cron/isolated-agent.auth-profile-propagation.test.ts --maxWorkers=1 --testTimeout=180000— 4/4 passed.node_modules\\.bin\\vitest.cmd run --config test/vitest/vitest.agents-core.config.ts src/agents/cli-execution-auth.test.ts— 19/19 passed. Coverage includes native-login preservation, omitted provenance, cross-provider fallback denial, explicit incompatibility, missing profiles, and backend-owned ordered profiles.runCronIsolatedAgentTurnpath, capturesauthProfileId: anthropic:managedat the CLI dispatch boundary, then runs the captured call through a registered CLI backend fixture using the realprepareCliRunContextandexecutePreparedCliRun. The fixture launches a real Node child process, and the observed output isanthropic:managed. This proves the selected profile identity crosses the cron-to-backend boundary; it is not presented as live Claude provider E2E.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo.git diff --checkpassed.check:changedremains unclaimed because an earlier run was interrupted in the core-test typecheck lane.reviewer_unavailable, no report produced).Limitations
The deterministic installed-backend proof verifies profile identity propagation and process execution. It does not claim a live Claude login, provider token refresh, or an account reassignment during an in-flight run.