Repository navigation
Conversation
OpenClaw-Publication: 4624f46d-8c80-4bd0-866f-947edb4e5306
|
🦞👀 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: blocked before merge. Reviewed September 14, 2026, 8:14 PM ET / September 15, 2026, 00:14 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserves models’ active-input budgets through catalog loading, provider registration, and registry snapshots, with regression coverage for budget precedence. Merge readiness⛔ Blocked before merge - 4 items remain The metadata repair remains useful and has convincing built-SDK before/after evidence, with no actionable patch defects found. Keep the explicit merge hold: the tested CLI routes did not reproduce widening, and the overlapping open PR is currently conflicted. Priority: P2 Review scores
Verification
How this fits togetherThe model registry turns provider catalogs and configured model definitions into runtime model records. Preflight and embedded execution consume those records to budget conversation context separately from native model capacity. flowchart LR
A[Provider catalogs] --> C[Model registry]
B[Configured models and registrations] --> C
C --> D[Runtime model metadata]
D --> E[Preflight budget]
D --> F[Embedded runtime policy]
F --> G[Context assembly and compaction]
Decision needed
Why: The author explicitly holds the merge, and the real CLI experiments contradict the broader regression claim while independently confirming the narrower SDK defect. Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +174. Total +179 across 3 files. View PR surface stats
Review metrics
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: Preserve the existing budget field at its registry owner, accept its documented SDK semantics explicitly, and keep unverified runtime impact separate from the metadata fix. Do we have a high-confidence way to reproduce the issue? Yes for metadata loss: current-main projections omit the existing field, and the supplied built-SDK comparison demonstrates it. No high-confidence end-to-end CLI widening reproduction is established; all three tested baseline routes retained the smaller budget. Is this the best way to solve the issue? Yes for the demonstrated metadata defect: forwarding the field through the existing registry is the narrowest repair. The evidence does not yet justify treating it as a complete fix for the reported CLI compaction behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9434fe6f0ad3. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
History |
Crabbox before/after results: metadata repair confirmed; runtime widening not reproducedI tested the built artifacts, then actual CLI agent turns against OpenAI. These are different proof levels and should not be conflated. Environment and revisions
Confirmed: built public SDK preserves the field after this PRI imported
The probe resolved the SDK from each revision's own Not reproduced: full CLI widening from 272k to 1.05MAn isolated receipt-only context-engine plugin recorded real
All four observed CLI turns exited zero. Independently parsed baseline results confirmed Example baseline runtime-override receipts: {"method":"assemble","tokenBudget":249832,"promptBudget":249832}
{"method":"assemble","tokenBudget":271985,"promptBudget":272000}
{"method":"commitTurn","runtimeBudget":272000,"nativeWindow":1050000,"messageCount":2}Interpretation / merge statusThe PR fixes a real, demonstrated metadata-loss bug. However, the live CLI paths above retain or recover the active budget elsewhere; these experiments do not establish which exact runtime route exhibits the widening described in #148575. The code has prepared/static model paths in addition to registry resolution, but the masking mechanism is not yet conclusively isolated. I am holding the merge under the request to obtain faithful runtime before/after proof first, despite passing exact-head CI, 141 focused tests, and clean P2 reviews. Head-only success is not sufficient evidence of an end-to-end fix. The remaining decision is to identify and reproduce the affected runtime route, or explicitly accept the narrower built-SDK metadata-preservation proof and narrow the runtime claim accordingly. No production Gateway configuration, credentials, or state was changed. The test engine is an observation fixture, not a validation of production lossless-memory compaction or a 272k-token workload. Commands and built-SDK reproductionThe lease uses the repository's configured backend: crabbox warmup --blacksmith-ref openclaw/fix-148575-context-budget --keep --timing-json
crabbox run --id tbx_01m2h4815d8ycy0g4cy7w20ntq --timing-json --shell -- '<isolated build/probe harness>'
# In each independently owned revision:
pnpm install --frozen-lockfile
pnpm build
# Live agent invocation in a separate temporary HOME/state/config/workspace:
node "$REPO/openclaw.mjs" agent --local --agent main --session-id "$UUID" \
--message 'Reply with exactly BUDGET_PROOF_OK. Do not call any tools.' --json --timeout 120
# Per-run override variant adds: --model openai/gpt-6-astra
# Cleanup:
crabbox stop tbx_01m2h4815d8ycy0g4cy7w20ntqRun this with import fs from 'node:fs';
import { ModelRegistry, AuthStorage } from 'openclaw/plugin-sdk/agent-sessions';
const catalog = JSON.parse(fs.readFileSync('./extensions/openai/openclaw.plugin.json', 'utf8'))
.modelCatalog.providers.openai;
const registry = ModelRegistry.create(AuthStorage.inMemory({}), 'captured:models.json', {
config: {}, modelsJsonContents: null, pluginCatalogs: [], includePluginCatalogs: false,
staticProviderConfigs: { openai: catalog },
});
const row = registry.find('openai', 'gpt-6-astra');
console.log({ contextTokens: row?.contextTokens ?? null, contextWindow: row?.contextWindow });This last SDK probe exits zero and returns absent/272000 before/after as shown above. The live runtime comparison does not reproduce the expected-before widening and must not be reported as a successful regression proof. |
|
Closing in favor of the pre-existing #141052, as requested by the maintainer. That PR already contains the same contextTokens registry-preservation repair, plus a separate ordinary-reply catalog fix. We will review the existing contribution rather than land a duplicate. The built-SDK before/after evidence and its limitations remain available at #148596 (comment). It confirms metadata preservation, not the reported full CLI budget widening; three tested baseline CLI routes already retained the smaller budget. Closing this duplicate does not resolve #148575 or establish that #141052 is ready to merge. |
Closes #148575
What Problem This Solves
Fixes runtime compaction budgets widening to a model's native context window when catalog loading drops its smaller active-input budget.
User Impact
Models retain their declared active-input budget after discovery, so preflight and the embedded runtime agree on the default budget. Explicit configured input caps, session-selected windows, and caller budgets retain their existing precedence. Native capacity remains separate; no configuration migration is needed.
Why This Change Was Made
The registry already receives
contextTokensfrom model catalogs but omits it when creating runtime rows. Preserve that optional field in the schema, catalog projection, and dynamic provider registration instead of adding a provider-specific fallback or lowering native model capacity.Evidence
The original focused tests were deterministic and credential-free. Additional Crabbox built-SDK and real OpenAI CLI results are documented below; no full repository test suite or production Gateway change was performed.
View the OpenClaw team session
Crabbox behavior verification
Built public SDK before/after proof confirms that this PR restores
contextTokens=272000while preserving native capacity1050000. However, three real CLI baseline configurations already delivered272000to the context engine, so the claimed end-to-end widening was not reproduced. The merge is on hold pending a faithful affected-route reproduction or an explicit maintainer decision on the narrower metadata-preservation scope.Detailed commands, environment, revisions, results, and limitations: #148596 (comment)