fix: repair model provider edge cases#89347
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 2, 2026, 2:23 AM ET / 06:23 UTC. Summary PR surface: Source +477, Tests +505. Total +982 across 27 files. Reproducibility: yes. from source inspection: adding Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Keep the useful provider fixes, but normalize the cron migration so upgraded rows only persist Do we have a high-confidence way to reproduce the issue? Yes from source inspection: adding Is this the best way to solve the issue? No; most fixes are on plausible owner surfaces, but the state migration is not safe until added cron columns are normalized to canonical values before runtime reads them. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 5be282e459ee. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +477, Tests +505. Total +982 across 27 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
e8437a5 to
2248511
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8437a55cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ensureColumn(db, "cron_jobs", "at TEXT"); | ||
| ensureColumn(db, "cron_jobs", "stagger_ms INTEGER"); | ||
| ensureColumn(db, "cron_jobs", "session_target TEXT NOT NULL DEFAULT 'main'"); | ||
| ensureColumn(db, "cron_jobs", "wake_mode TEXT NOT NULL DEFAULT 'auto'"); |
There was a problem hiding this comment.
Use a valid cron wake-mode default
For older cron_jobs tables, this ADD COLUMN can leave rows with wake_mode = 'auto' whenever job_json is malformed or fails the strict backfill path. CronWakeMode only allows now or next-heartbeat (src/cron/types.ts:23), and the timer path treats anything other than now as a deferred heartbeat event, so affected legacy jobs can silently stop waking immediately after the DB is opened. Default this column to now (matching normalizeCronJobInput) or force-normalize invalid values after the backfill.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35ea3ca49c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| failure_alert_include_skipped = ?, | ||
| failure_alert_mode = ?, | ||
| failure_alert_account_id = ?, | ||
| runtime_updated_at_ms = ? |
There was a problem hiding this comment.
Backfill cron runtime state too
When opening a legacy cron_jobs table that only has job_json, this backfill extracts the config fields but never writes state_json or the split runtime columns such as next_run_at_ms, last_run_at_ms, and delivery/error state. loadCronRows reconstructs job state from those columns/state_json, not from job_json, so existing scheduled jobs on this upgrade path lose their persisted nextRunAtMs and run history and can be skipped or rescheduled incorrectly. Copy job.state into state_json/the state columns during this backfill before considering the row migrated.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66d8b1c17e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| const update = db.prepare( | ||
| `UPDATE cron_jobs | ||
| SET name = ?, |
There was a problem hiding this comment.
When upgrading a legacy cron_jobs table that only has job_json, this backfill copies name and other config fields but never sets the new description column. rowToCronJob reconstructs store.jobs from the split columns and only reads row.description, so any legacy job with a description in job_json loses it in list/search/update flows immediately after the DB is opened. Include description = ? populated from job.description in this migration path.
Useful? React with 👍 / 👎.
| delivery ? textField(delivery, "mode") : null, | ||
| delivery ? textField(delivery, "channel") : null, | ||
| delivery ? textField(delivery, "to") : null, | ||
| delivery ? textField(delivery, "threadId") : null, |
There was a problem hiding this comment.
Preserve numeric cron thread ids
For legacy cron jobs whose delivery used a numeric threadId (allowed by CronDelivery and normally stringified by bindDeliveryColumns), this backfill calls textField(delivery, "threadId"), so the value becomes NULL and subsequent delivery no longer targets the configured thread/topic. Coerce finite numeric thread ids to strings here like the normal persistence path does.
Useful? React with 👍 / 👎.
|
Land-ready proof for exact head
Known scope note: issue #88201 was live-checked and is not closed here; direct API vs local inference overhead is improved from the original report but still materially different. |
Summary
OPENAI_BASE_URL/ANTHROPIC_BASE_URLdefaults across OpenAI, Anthropic, and native PDF pathslong/nonewithout forwarding OpenAI-incompatible cache paramsapply_patchprovider-neutral while preserving explicit disable and allow-model gatesRefs #74427, #74432, #79370, #88359, #88357, #45269, #80366, #80347, #79894.
Verification
node scripts/run-vitest.mjs src/state/openclaw-state-db.test.ts -- --reporter=verbosenode scripts/run-vitest.mjs extensions/openai/base-url.test.ts extensions/openai/openai-provider.test.ts src/agents/anthropic-transport-stream.test.ts src/agents/tools/pdf-native-providers.test.ts -- --reporter=verbosenode scripts/run-vitest.mjs src/agents/embedded-agent-runner/prompt-cache-retention.test.ts src/agents/embedded-agent-runner/extra-params.openrouter-cache-control.test.ts src/agents/embedded-agent-runner-extraparams-openrouter.test.ts src/agents/anthropic-payload-policy.test.ts src/llm/providers/stream-wrappers/proxy.test.ts src/llm/providers/stream-wrappers/anthropic-cache-control-payload.test.ts -- --reporter=verbosenode scripts/run-vitest.mjs src/agents/agent-tools.create-openclaw-coding-tools.test.ts src/agents/agent-tools-agent-config.test.ts -- --reporter=verbosenode scripts/run-vitest.mjs src/commands/model-picker.test.ts src/commands/configure.gateway-auth.prompt-auth-config.test.ts -- --reporter=verbosenode scripts/run-vitest.mjs extensions/github-copilot/provider-policy-api.test.ts extensions/github-copilot/index.test.ts extensions/github-copilot/models.test.ts -- --reporter=verbose -t "provider-policy-api|xhigh|reasoning efforts|static overrides"node scripts/run-vitest.mjs test/scripts/codex-media-path-client.test.ts test/scripts/config-reload-log-scanner.test.ts -- --reporter=verbosenode scripts/run-oxlint.mjs scripts/e2e/lib/incremental-line-reader.mjspnpm check:changedvia Blacksmith Testboxtbx_01kt3em5r9vd7g0bnykrff6jdk(providerblacksmith-testbox, exit 0)Notes