Skip to content

fix: make automation billing accounts explicit - #201288

Draft
roboclaw-bot wants to merge 30 commits into
mainfrom
openclaw/oceanic-barnacle-2
Draft

roboclaw-bot wants to merge 30 commits into
mainfrom
openclaw/oceanic-barnacle-2

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What problem this solves

A scheduled prompt can keep using a billing account that its owner cannot see in Automations. Another job, created without a saved account, can stop when its conversation switches to a stored account that works in chat.

User impact

Open the automation or run openclaw automations show <jobId> to see the saved billing account. A job that selects its account at run time says so. An automation can follow a model alias and keep its chosen account when the alias moves.

A prompt with no saved account uses the account selected by its agent or conversation. A recorded account still governs its own provider, including refusal if the credential is removed or replaced. New main-session reminders follow their chat. Older reminders can still adopt an account through Doctor or an explicit account edit. Account selection · Main-session reminder recovery · Operator reports

Evidence

Compared main b9ddb611c5 with the PR runtime 82b133b053.
Both private Gateways opened copies of the same SQLite state. A local model served requests through three synthetic accounts. The provider default was openai:studio.

Automation Main PR
Conversation switched to openai:daily Run refused before a provider request Run completed on openai:daily
Garden alias moved from gpt-4.1 to gpt-4o Ran gpt-4o on openai:reports. The account was hidden. Ran gpt-4o on openai:reports. The UI and CLI showed the saved account.
Main-session reminder Followed the chat account. An explicit account edit kept the reminder and used the selected account. Same result. The reminder kept its ID and text and ran on openai:reports after the edit.

Both builds retained the original successful alias run and the recorded account authorization. A separate 2026.11.11 Gateway reproduced the unbound-job refusal. The source package identifies itself as 2026.11.10 and refused the 2026.11.11 configuration, so the paired comparison used state created on main.

Core and Control UI typechecks, touched-file lint, formatting, and both runtime builds passed. Across the local runs, 31 distinct focused cases passed. The migration test that timed out during unrelated Doctor setup exercises the account repair directly under offline maintenance and passed in 47 seconds. The adjacent personal-account case and the Gateway alias regression also passed.

Automation details

Chromium shows the saved account and the run-time selection on the same two automations. Each image stacks matching crops from the real Control UI.

Main

Main shows the schedule and model without a billing account for either automation

PR

The garden report shows openai:reports and the garden notes select an account at run time

Annotated comparison

Main

The schedule is highlighted in each main detail view, where the billing account is absent

PR

The saved account and the run-time selection are highlighted in the PR detail views

Co-authored by Vyctor Brzezowski.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 18, 2026 14:49
Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: e1458b99-060d-858f-a8bd-316c22a9bdd2
@clawsweeper

clawsweeper Bot commented Nov 18, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL labels Nov 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR replaces hidden automation billing bindings with explicit model-profile pins and migrates existing saved accounts.

Example: A weekly report has privately recorded account openai:reports while inheriting openai/gpt-4.1.

  • Before: The editor shows Default without exposing the recorded billing account.
  • After: Migration saves openai/gpt-4.1@openai:reports, making the account visible and editable.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A worthwhile, coherent cutover with visual and reported runtime/upgrade evidence; draft status and unfinished or unattributed CI prevent a landing-ready conclusion.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected screenshots verify the changed Control UI presentation; the public record describes real CLI/Doctor and installed Gateway runs, including v2026.11.10 upgrade preservation and loopback credential selection. Compatibility evidence covers cron_jobs.job_json conversion from inferenceBinding to payload.model, modelRuntime, and modelAuthProfileAuthorizationId, plus transfer and pause markers. These runs were supplied evidence, not executed during this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Users cannot see a privately captured billing account, and an unpinned automation can refuse credentials that otherwise work for its agent.
Reason: The direction changes intentionally designed account continuity, but maintainer authorship supplies that decision; visible pins and migration provide clear user value.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides a coherent account-selection cutover that current main does not implement; no definite introduced code defect was found.

Reviewed head: f4afba1bc1f2360f071338b77ee774e610546cad

Before merge

None.

Findings

None.

Agent review details

How this fits together

Automation creation and editing persist scheduled jobs; startup and Doctor migrate old definitions, and scheduled execution resolves their model, runtime, and credentials before contacting a provider.

flowchart TD
  A[Automation editor or CLI] --> B[Gateway validation]
  B --> C[Cron mutation owner]
  D[Startup or Doctor migration] --> C
  C --> E[Stored cron definitions]
  E --> F[Scheduled run admission]
  F --> G[Model and credential selection]
  G --> H[Provider request]
Loading

Technical review

Best possible solution:

Complete the explicit-pin cutover through the existing credential owner and backed-up migration, preserving the documented fallback and ownership-transfer behavior.

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

Current-main source establishes private account bindings and unrecorded-account refusals, and the inspected before/after screenshots establish the hidden-choice problem; this review did not run the product.

Is this the best way to solve the issue?

Reusing model@profile and the shared credential owner removes competing account-selection state while the migration preserves existing billing choices and explains pauses.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Private automation account continuity changes intended behavior with a stated reason (d25a316: Prevent interactive defaults and credential ordering from silently changing automation identity or billing.)
  • Captured runtime continuity keeps the original intent (f31b33f: Keep scheduled execution on the runtime associated with its selected account instead of a later copied session override.)
  • Cross-provider fallback keeps the original intent (e8ff306: Allow configured fallback providers to use their own credentials when the recorded provider cannot serve the run.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit e8ff306 adds src/cron/run-inference.ts:97 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e8ff306f7413; files: src/cron/run-inference.ts)
  • Jason (Json): Raw commit a16a27e adds src/cron/isolated-agent/session.ts:116 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a16a27ea8682; files: src/cron/isolated-agent/session.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Public payload additions 1 writable field: modelRuntime The field preserves a migrated account's recorded runtime; inferenceAccountPauseReason is separately exposed as read-only job information.

Labels

Label changes:

No label changes.

Label justifications:

  • merge-risk: 🚨 compatibility: The maintainer-selected direction changes unpinned account selection and rewrites legacy job definitions, preserving compatible selections and deliberately pausing unverifiable routes.
  • merge-risk: 🚨 auth-provider: The change affects credential selection, stored credential identity, native CLI authentication, and cross-provider fallback.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-11-28T04:15:06.209Z sha f13db80 :: blocked before merge. :: [P2] [P2] Seed the pinned credential before adding the transfer fixture
  • reviewed 2026-11-28T04:31:14.068Z sha d7b2de0 :: blocked before merge. :: [P2] [P2] Seed the pinned credential before adding the transfer fixture
  • reviewed 2026-11-28T06:21:09.530Z sha 9bc4ab5 :: blocked before merge. :: [P2] [P2] Preserve the selected profile during fallback admission
  • reviewed 2026-11-28T07:09:57.996Z sha 6849146 :: blocked before merge. :: none
  • reviewed 2026-11-28T08:17:32.938Z sha e9cf923 :: blocked before merge. :: none
  • reviewed 2026-11-28T09:48:33.198Z sha b21b047 :: passed. :: none
  • reviewed 2026-11-28T12:47:43.258Z sha eb2d3fd :: needs changes before merge. :: [P2] [P2] Recognize native-login reselection after ownership transfer
  • reviewed 2026-11-28T13:34:20.238Z sha b85cc66 :: passed. :: none

Reviewed November 28, 2026, 9:11 AM ET / 14:11 UTC (Revision 16).

roboclaw-bot and others added 2 commits November 27, 2026 02:12
Merge main without rewriting the PR history. Keep legacy account rows available for Doctor conversion and preserve explicit model pins across default changes.

Co-authored-by: daniel-lxs <[email protected]>
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Nov 27, 2026
@daniel-lxs
daniel-lxs force-pushed the openclaw/oceanic-barnacle-2 branch from 143cdde to 251216f Compare November 27, 2026 11:38
@daniel-lxs
daniel-lxs marked this pull request as ready for review November 27, 2026 11:39
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Nov 28, 2026
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 28, 2026
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 28, 2026
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Use the account selection from #202833, including explicit session accounts.
Keep existing account captures, model aliases and upgrade-receipt recovery.
Remove the obsolete boot adoption of jobs without a saved account.
Expose the account selection alongside the saved model without publishing
the authorization record or changing how edits and model aliases work.
…ling

Integrate #207275. Legacy system-event reminders retain their account adoption and explicit repair, and new reminders follow the chat. Apply #202833's live account selection to unbound agent turns and preserve recorded provider accounts.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants