Repository navigation
Conversation
Keep automatically selected skill resources within the existing worker delivery bound with explicit omission notices, and stop model fallback on typed delivery-limit errors. Record actual queue blockers and separate writer and placement admission from global capacity waits.
|
🦞👀 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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a607d07aa
ℹ️ 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 remaining = | ||
| SKILL_LIBRARY_MAX_BUNDLE_BYTES - | ||
| total - | ||
| Math.min(deliveredCandidates.length - index - 1, deliverySlots - skills.length - 1) * 1024; | ||
| if (bundleBytes > remaining) { |
There was a problem hiding this comment.
Preserve complete catalogs that already fit the byte limit
When later skills need fewer than 1,024 bytes each, reserving a fixed 1,024 bytes per candidate can unnecessarily discard supporting files from a catalog whose complete contents fit within 8 MiB. For example, a first bundle of 8 MiB - 512 bytes followed by a 100-byte instructions-only skill previously delivered successfully, but now the first bundle exceeds the artificially reduced remaining budget and loses all its supporting files. This makes previously available scripts and references unavailable without an actual aggregate overflow. Determine whether the complete catalog exceeds the limit before reducing resources, or account for the actual remaining resource sizes.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR bounds worker skill delivery with explicit omission notices, stops deterministic delivery-error fallback, and separates lane, writer, and placement wait diagnostics. Example: A worker turn selects 150 skills totaling 11,992,050 decoded bytes.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this PR addresses current delivery failures and misleading admission diagnostics, but two introduced defects need correction before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherSelected skill snapshots enter the resource-delivery owner before worker inference, while the execution controller obtains queue capacity, a session writer, and placement admission and exposes their timing to diagnostics. flowchart TD
A[Selected skill snapshot] --> B[Resource delivery owner]
B --> C[Worker inference]
D[Admitted turn] --> E[Command queue]
E --> F[Writer and placement admission]
F --> C
E --> G[Admission diagnostics]
F --> G
Technical reviewBest possible solution: Keep bounded delivery and deferred diagnostics in their existing owners, preserve complete catalogs that fit, and place queue contracts in an acyclic type boundary. Do we have a high-confidence way to reproduce the issue? Current main exposes the aggregate-overflow failure directly, and source inspection establishes both introduced defects; the PR reports red-to-green owner regressions, but this read-only review executed no target code. Is this the best way to solve the issue? The existing resource owner and controller are the appropriate repair boundaries, but conservative byte reservations must not remove valid resources and diagnostic types must not introduce import cycles. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 20bc9c662bd4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +151, Tests +199, Docs +57, Other +154. Total +561 across 29 files. Added test files: 0. View PR surface stats
Preflight sourceSource 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
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 7, 2026, 10:34 PM ET / November 8, 2026, 03:34 UTC. |
Restore cron completion fault injection against the recorded completion fact.
…penclaw#194964) * fix(agents): bound skill delivery and attribute lane admission waits Keep automatically selected skill resources within the existing worker delivery bound with explicit omission notices, and stop model fallback on typed delivery-limit errors. Record actual queue blockers and separate writer and placement admission from global capacity waits. * perf(agents): defer admission diagnostic formatting * fix(queue): keep admission diagnostics on leaf types Restore cron completion fault injection against the recorded completion fact.
Release adaptation: backport only the Socket Mode reconnect waiter owner and focused regression tests; omit the performance harness and main-only transport documentation addition. Add listener-count assertions for timer settlement and disconnect cancellation; adjust the test allocation to 41. Companion dispositions: #198007 is specific to SDK 3.2 callback/abort semantics and is not applicable to this line pinned to socket-mode 3.1.0. #197657 retires main allocations; other audit hits (#200523, #197009, #194964, #184507, #192197, #192051, #190003, #189850) only overlap the excluded shared perf README. No later #188745 mention through bd692e9. (cherry picked from commit a1d1da7) Co-authored-by: RomneyDa <[email protected]>
…penclaw#194964) (cherry picked from commit 90dfe90) Release adaptation: Select required/pinned/explicit slots before resource tree reads, fill available discovery slots after vanished optional roots, retain existing 8 MiB aggregate hard refusal and whole instructions. Existing SkillResourceDeliveryLimitError retained and added to failover terminal coordination handling. Explicitly excludes source omission/truncation fallback and all lane instrumentation. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 229003c59543ddaa632a853e2032344ae686b805)
What Problem This Solves
Automatically selected skills can exceed the worker's aggregate resource budget before inference, then repeat the same deterministic failure through model fallback. Startup diagnostics also label writer and placement admission as global lane waiting, hiding the blocking phase.
Oversized catalogs now produce a working turn within the existing 8 MiB decoded-resource bound. The existing delivery owner prioritizes prompted, explicit, and pinned skills, reserves bounded omission notices, and retains whole instructions where they fit. Otherwise it delivers an explicit unavailability notice. The model is told which supporting files are unavailable and how to continue. Instructions are never silently truncated. Typed delivery-limit errors stop model fallback immediately; publication and transport integrity limits remain unchanged.
Why This Change Was Made
Admission phase transitions update scalar facts on the existing controller admission record. The queue lends its existing entry to that record and retains the same entry for active-holder identity. The revision removes eager holder snapshots, extra task closures, string building, and diagnostic arrays from queue admission. No new timer or cache is introduced. Existing periodic stuck-session reporting and slow-send logging format the facts only when emitting a diagnostic.
Live stuck diagnostics name the lane/group capacity, enqueue position, and up to 64 current holders. Completed slow-send diagnostics retain enqueue counts and cumulative lane/writer/placement durations, including readmission and fallback attempts; they deliberately do not misrepresent current holders as historical blockers. The caller's predictive queue scan is removed. Task duration starts after lane admission, so it does not establish queue-wait duration. No capacity-release leak was found or claimed fixed.
User Impact
A first turn that waits in writer or placement admission is now reported under its real phase instead of
global_lane:waiting, deterministic skill-delivery-limit errors fail fast instead of retrying through model fallback, and oversized skill selections are delivered within the worker limit with a model-visible note instead of failing the turn.Evidence
Measurement
Original main parent:
b97bc15cd7afd6eea35c68c6dfb0cc07706a8671. Five A/A timing pairs followed by five AB/BA blocks (ten comparison samples per arm), with allocation measured separately using two A/A pairs and five AB/BA blocks. Identical harnesses run against the original owner source overlay and the revision. Allocation includes sampled collected objects, not merely retained heap. Wall/CPU numbers below come from unprofiled runs.All median regressions are below 5% and within A/A variation. Queue A/A median halves: wall 12.835/13.076 ms, CPU 23.070/23.383 ms, allocation 34.910/34.783 MB. Queue A/A full ranges were wall 12.656–51.055 ms (one noisy outlier), CPU 21.999–30.243 ms, allocation 34.313–35.253 MB. Ordinary skill A/A median halves: wall 10.673/11.974 ms, CPU 12.004/13.815 ms; allocation range 5.153–5.235 MB. This is a shared-host local measurement, not a production latency claim.
The saturated fixture uses 4,096 synthetic session identities: 32 waves of 32 holders and 96 waiters. Every revision run settles all turns and exposes 3,072/3,072 queued admissions, with no remaining active/queued work. The 13-minute regression reproduces a saturated lane and verifies the real stuck-diagnostic and slow-send output. Ordinary preparation runs 50 calls per sample and preserves all 32 file reads and 1,302,894 payload bytes per call, with zero failures.
The earlier oversized fixture remains synthetic: 150 skills with 11,992,050 source bytes alongside 61,700 unrelated files containing 1,110,600,000 bytes. Its worker regression is rerun on this revision and completes with a clear note. Queue and resource owners do not read a session database or scan unrelated workspace files; no btrfs or 35 GiB database performance claim is made. No production access or data copying was used. Commands and limits are documented in
scripts/perf/README.md.Validation and size
The original fallback, oversized-resource, worker-completion, and attribution regressions fail on the pre-fix owners. Focused queue/controller/watchdog, resources/worker, diagnostics, fallback, and prompt-prefix suites pass. The Control UI dependency is type-only; affected UI unit tests (2) and Chromium diagnostics E2E (1) pass. Codex autoreview of the full revision against the original base is scoped-clean at P0–P2; the reviewer examined source and proof but did not independently execute the project.
Production delta is +153 lines versus the original base, up from +104 in the first revision; test delta is +199. The resource owner simplification removes a redundant byte reduction and avoids decoding instructions that cannot be retained, but the total LOC reduction goal was not achieved. Growth supplies the explicit transition state, optional watchdog projection, bounded cold diagnostic reader, and cumulative attempt accounting. The hot queue/controller path is smaller; moving collection off that path requires those cold readers. No new configuration, cache, schema, protocol version, dependency, or cap increase.
pnpm check:changed --staged --base 8a607d07aa275d48d87bd93d1f884da2545f34cewas run for the revision. It completed with the two inherited gates below and two revision-owned TypeScript errors: a synthetic queue-entry fixture lacked its now-required lane, and the inferred wait array made the optional admission field required. The final change uses the canonical snapshot element type for that existing array, with no runtime behavior change. Core, scripts, and all core-test typecheck graphs pass after those corrections; the seven cancellation tests also pass. All other changed checks passed. The mechanical type annotation and one fixture field follow the clean autoreview; neither changes runtime behavior.Two broad gates were already red on the exact main parent and remain unresolved main regressions:
266a7aa0fe69/ fix(release): align attribution gate with human credit policy #194364 changed policy without reconciling archived credits; the exact base reproduces the same 20 rejected records.5e1a27a9bcc4/ fix(release): validate credits in selected publication notes #194899 removed the last consumer ofreadReleaseChangelogFiles;c339698bbd7e/ fix(gateway): keep Last updated position when marking a session unread #194839 removed the last external consumer ofisSessionUnreadAckOnlyPatch;9151ac22e005/ feat(ui): ask about a selection in a new session #194721 exported the internally usedCommandPaletteOpenDetail;adca0b0844c7/ perf(ui): split cold Chat construction across paint frames #194815 wrapped a Solid lazy import so Knip no longer recognizes the still-usedOpenClawShell. An isolated archive of the exact base reproduced all four signatures with working root and UI dependencies.CI repair after c433cc0
The previous revision introduced a real static import cycle:
command-queue.state.ts → command-queue.types.ts → command-queue.state.ts. The runtime-only cycle guard excludes type edges, so its green result did not cover this defect. The callback and diagnostic timeline now consumeCommandQueueWait, a four-field leaf contract in the existing types owner. Queue state implements that contract and still lends its existing entry. No barrel, lazy import, runtime object, or additional diagnostic work is introduced. Madge fails before this repair and both Madge and runtime import-cycle guards pass afterward.The failed cron test injected its finalization error only when diagnostics reported
idle. Main commitee3ec605a59c859ba0ad68efe9c199481c543b52/ #194907 correctly preservesprocessingwhile a controller lease is active, so that fixture stopped injecting its error. The test now targets the recorded completion fact (consumeQueuedTurn) and retains both its rejection and released-admission assertions. The unchanged test reproduces the identical CI failure on the exact main parentb97bc15cd7afd6eea35c68c6dfb0cc07706a8671(14 pass, 1 fail) as well as the previous PR head. This repairs an inherited main test regression; production cron lifecycle behavior is unchanged.This follow-up adds two net production type/comment lines and zero net test lines. Previous performance measurements remain applicable to the unchanged queue and resource runtime. Full affected proof: 17 queue/controller/watchdog/diagnostic files pass (264 tests); all seven original CI cron files pass (39 tests), plus the three message-lifecycle tests. Core and all core-test typecheck graphs pass. Both cycle guards pass. Fresh Codex autoreview of this repair is scoped-clean at P0–P2; it reviewed source but did not independently execute tests or verify historical attribution. The exact-parent failure and introducing patch were verified separately.
pnpm check:changed --staged --base c433cc0b1c56d8969eac46cf9554557913654017completed with every gate passing except the same previously proven inherited changelog-attribution and dead-export failures listed above. No new failure signature remains locally.No merge or automatic merge is requested.