Repository navigation
refactor(agents): keep private execution phases with their owners - #180961
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 SummaryThis 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: a592fb275b
ℹ️ 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".
| }, | ||
| ); | ||
| } | ||
| // Parsed headers need a bracket or angle delimiter, written literally or as an entity. |
There was a problem hiding this comment.
Update the QA scenario to the relocated diagnostics
After moving the transcript-role detection here, qa/scenarios/ui/control-ui-assistant-transcript-role-boundary.yaml:25 still names the deleted src/agents/embedded-agent-subscribe.tool-text-diagnostics.ts. QA Lab publishes these codeRefs into both the agent workspace and evidence summaries, so this scenario now supplies a dead source reference instead of the implementation being exercised; point it at this lifecycle module as part of the cutover.
AGENTS.md reference: AGENTS.md:L51-L52
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR folds private execution and host-utility helpers into their existing production owners. Example: A reply requires preflight compaction.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: the maintainer-directed refactor is useful, but migrated fixture cleanup introduces a confirmed CI failure and one QA source reference remains stale. Priority: P3 Before merge
Findings
Agent review detailsHow this fits togetherAgent turns, session claims, provider credentials, and host settings enter existing runtime owners, which prepare execution, preserve resource custody, and produce replies or host operations. flowchart TD
A[Incoming agent turn] --> B[Turn preparation]
B --> C[Admission lifecycle]
C --> D[Embedded execution]
D --> E[Attempt normalization]
D --> F[Message completion]
G[Host utility callers] --> H[Private operations within owners]
Technical reviewBest possible solution: Keep the owner-local folds, move borrowed-fixture disposal outside the retaining turn callback, and update the QA scenario reference. Do we have a high-confidence way to reproduce the issue? The fixture failure is supported by exact-head CI annotations and a source trace through withSessionTurn execution retention, deferred completion, and successor-barrier publication; no local run was performed. Is this the best way to solve the issue? Folding sole-consumer helpers into existing owners fits the repository contract, but fixture cleanup must respect the outer execution lifetime. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cf2558f5639e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -271, Tests +75, Other -2. Total -198 across 46 files. Added test files: 2. View PR surface stats
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 October 22, 2026, 4:54 PM ET / 20:54 UTC. |
PR180961 exact-head final accountingHead1e3981240d785e756f4cb8610ee1fdd7d29a6127; CI39853368463 attempt1 completed/failure. Paginated exact-head census z25-ci104-final-checks.json contains183 terminal checks:124success/54skipped/1neutral/2failure/2cancelled; zero pending. This supersedes the earlier180-check pending snapshot in z25-ci104-current-attribution.md.
Cancelled metadata120085098521 and120085097550 have positively verified same-head/same-workflow successful replacements120085207402 and120085208056. Actual evidence/dispatch steps passed. No cancelled test suite or missing proof is excused. Security-fast120087540422 and all production/test typecheck jobs pass. Checkout recorded in failed log is7dd8de291add81a6afa13a3d410bce1571a2b43a, ordered parents60c9291360c93c54a0d8be7cffd799a0ef6014c2 and1e3981240d785e756f4cb8610ee1fdd7d29a6127, tree83e2298790a671bbaf64d3969d882167b10b6f3b. Independently reconstructed merge tree matches. Baseline is ancestor of captured main. Selected failure/planner/test/authority sources are byte-identical baseline to tested merge. Whole trees are not claimed equal; PR changes are included. Latest six completed scheduled runs inspected:39849675545,39840622841,39832966696,39823514819,39815322394,39805986795. Main-flakes registry has no matching entry; actual398406 signature and unchanged inputs establish inheritance. No rerun, dispatch, rebase or push for green. Local suppression inventory104vs100 remains investigated and honestly failed; no allowance changed. All other focused structural checks passed. Phase E untouched. |
|
Exact reviewed/prepared head: Using the campaign-authorized exact-head guarded squash fallback after two genuine native inherited-only submissions failed on the retained workflow's Security Review matcher: this PR and #181042. Independent prepared PRs, not blind retries; operator setup/path errors are excluded. Both native refusals occurred before intent/dispatch, with locks/children released. No workflow binding or receipt is edited and no security gate is waived. Retained workflow9b49df67 accepts only CI 39853368463, attempt1, completed failure. Fresh paginated exact-head census201 entries, all terminal; no additional failed leaf since the earlier183-entry receipt.
Cancelled metadata120085098521 and120085097550 have successful same-head replacements120085207402 and120085208056; no cancelled test execution waived. Security-fast120087540422 and all production/test types pass. Repaired fixture's118 unchanged public cases and focused ownership proof pass; original investigated local suppression-inventory failure remains honestly recorded, without allowance growth. Current-mainaf059b5 to exact head merges without conflicts. All47 PR paths' production/test inputs are unchanged since actual CI base60c92913 except wrapper-inventory metadata (two additions/one unrelated retirement), which merges cleanly. Main behavior is preserved, not overwritten. No drift-only rebase/push/rerun for green. Fresh independent P0–P2 review and scoped proof retained. Phase E remains untouched. Guarded fallback pins the exact head above; merge/ancestry will be verified separately. |
…enclaw#180961) * refactor(agents): prepare Gemini cache auth at its sole caller * refactor(media): initialize MIME reverse table at its owner * refactor(markdown): render table fallbacks at their sole owner * refactor(usage): label windows at their projection owner * refactor(promos): label expiry at the rendering owner * refactor(daemon): keep environment assembly in its consumer * refactor(system-agent): own post-write repair in the chat engine * refactor(infra): bind native resources in their worker owner * refactor(daemon): keep installed ownership scanning in its inspector * refactor(agents): retire the compaction predicate forwarding module * refactor(agents): diagnose suspicious text at message completion * refactor(agents): adopt attempt identity in normalization * refactor(tui): keep model catalogs in their client owner * refactor(reply): keep preflight in turn preparation * refactor(claws): apply draft selections in archive preparation * refactor(reply): bind database admission in its lifecycle owner * test(reply): retire fixture admission after outer execution settles
What Problem This Solves
Agent execution and host utilities expose private helpers and modules that have only one production consumer.
User Impact
No user-visible behavior change. Auth and tool authority, public SDK/CLI/config/protocol contracts, lazy imports, and durable user state remain unchanged. The standalone session-memory backend and its machinery are untouched.
Why This Change Was Made
Fold private phases into their existing owners: attempt identity normalization, reply preflight and database admission, suspicious-text diagnostics, Gemini cache auth, TUI model catalogs, native resource binding, daemon environment/ownership inspection, system-agent post-write repair, Claw draft selections, usage/expiry labels, and small Markdown/MIME assembly frames.
This is the agent/host area slice of the z25 single-consumer family, split under campaign rule 11 because the combined family reaches 82 files. It removes 271 net production lines (+956/-1,227), excluding tests, fixtures, support, generated files, and declarations. Moved algorithm bodies receive no deletion credit. Existing owners and public entry points replace the old private seams; no new test-only production API is added.
Best-effort tradeoffs accepted
Evidence
Every cut received focused boundary tests, targeted native types/lint/format, a simplify pass, and fresh independent P0-P2 review. Private-entry test migrations were proven with production unchanged before the corresponding folds. Relevant proof includes normalization's 30 cases, reply preflight's 48 cases, TUI's 125 cases, Claw draft publication/privacy's 17 cases, native resource lifecycle/transport's 22 cases, Gemini cache/prefix stability's 58 cases, and public database-admission/fixture's same 178 cases across ten suites before and after the fold. Two launchd rows pinning a second query already removed by #168882 were retired; native parser/error and real duplicate-manager coverage remain.
The database fixture now completes its operation, joins the exact-target successor barrier, and verifies the original claim is retired; owner settlement alone is not treated as database-release proof. No local builds, broad suites, whole-graph types, or E2E were run; exact-head hosted CI supplies broad proof. No live service or operator state was touched. No retries, skips, timeout increases, new suppressions, or allowance growth.
The required local suppression-inventory test retains its unrelated fresh-main failure (13 pass, one failure; 104 observed rows versus 100 allowlisted). Extra rows are in unchanged
scripts/perf/idle-gateway-measure-preload.mjs,src/cron/store/job-mutations.ts,src/transcripts/library.query-budget.test-support.ts, andui/src/pages/sessions/view.tsx. The test and those inputs are byte-identical to main; no suppression or allowance is added here.The production cutovers match the reviewed and tested source family after conflict-free composition on fresh main. Among selected paths, main drift touched only existing shrink-only ratchet inventories. Hosted CI verifies the full dependency composition.
The first exact-head CI exposed an incomplete test-fixture migration: fixture disposal ran inside
withSessionTurn, before that outer owner released retained execution, so its database claim could not retire yet. The repair disposes after the outer turn and returns the existing bound admission fact needed by the durability consumer. Production code, test expectations, and claim-retirement checks are unchanged. The original auth-guidance case fails before this repair; afterward, all eleven CI-failed execution suites plus durable capacity admission pass unchanged: 118 cases across twelve files. Targeted native types, typed lint, format, line caps, and fresh independent P0-P2 review also pass.Repaired-head CI 39853368463, attempt 1 at
1e3981240d785e756f4cb8610ee1fdd7d29a6127, completed. All execution/type jobs passed. Complete exact-head accounting: 183 terminal checks, 124 success, 54 skipped, one neutral, two failures, and two cancelled metadata executions with verified same-head/same-workflow successful replacements. No missing test suite is waived.commands-plugin.scheduled-turns.test.ts. Same case/row/stack on scheduled main 39840622841, job120040645368. Determining planner/test/authority inputs are unchanged.The aggregate's informational
newlabel compares a same-named newest-main shard without comparing selected scope. Actual matching-signature proof comes from the earlier scheduled run within the inspected latest six, not from job-name similarity. Main-flakes registry has no matching entry. The authorized native inherited-failure exception preserves this red CI and the separately investigated local inventory failure; neither is presented as green. No CI rerun or re-push for green.Fresh-main structural proof passes: zero runtime cycles, zero static cycles, assertion-safety and mock-export ratchets, the selected wrapper/eager-import closure contracts, and the native line-cap ratchet (32 source files, no new violation or over-cap growth).
Native landing is currently refused before dispatch by an old retained tooling parser, not by missing security clearance. Security Review39856898261/job120097432174 passed its exact-head enforcement step. Its job name includes the selected CI run and attempt; the retained workflow recognizes only the older two-field name. #180929 corrects that parser on main. No merge intent was created, no binding or receipt was changed, and no security gate was bypassed. The existing documented current-workflow recovery requires a retained cancelled-auto or qualified REST405 outcome, neither of which exists here. Necessary review/preparation/evidence remains intact while other campaign work continues.