Repository navigation
perf(agents): skip disabled debug preparation - #150361
Conversation
Punchcard-Session: clear-workshop-brook-w2
|
🦞👀 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: needs maintainer review before merge. Reviewed September 18, 2026, 12:34 AM ET / 04:34 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR skips agent-stream diagnostic preparation when debug logging is disabled, adds logging and stream-option regression coverage, and updates planner tests to recognize inherited worker limits. Merge readiness✅ Ready for maintainer review The optimization remains useful: current main and the latest release still prepare disabled diagnostics. No actionable correctness or security findings were identified, and the prior review contains no outstanding concrete findings. Priority: P2 Review scores
Verification
How this fits togetherThe embedded agent runner combines configured model parameters with per-request options before invoking a provider stream. Its subsystem logger independently controls file and console diagnostics. flowchart TD
A[Configured model parameters] --> B[Prepare stream wrapper]
B --> C{Debug enabled in either sink?}
C -->|Yes| D[Prepare and emit diagnostics]
C -->|No| E[Skip diagnostic work]
B --> F[Resolve retention for each request]
F --> G[Provider stream with request options]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +251. Total +251 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep diagnostic preparation behind the existing logger enablement check while preserving per-request retention resolution and option precedence. Do we have a high-confidence way to reproduce the issue? Yes, from source: constructing a wrapper with recognized parameters on current main performs diagnostic retention resolution and serialization even when both debug sinks are disabled; this review did not execute that path. Is this the best way to solve the issue? Yes. Reusing the existing sink-aware logger guard removes the unnecessary work without changing provider invocation or creating another policy owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a225ce456f2a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Punchcard-Session: ember-river-harbor-t4
Integrate current main while retaining the CPU debug serialization fix. Preserve explicit cap validation for serial jobs that inherit a job-level two-worker limit. Punchcard-Session: ember-river-harbor-t4
|
Merged via squash.
|
Recognize the two-worker ceiling retained by a promoted job after #151339 finalizes Gateway admission before placement. Keep every other group field strictly equal and preserve the landed controls from #150361. Reject missing or raised job caps in the existing promoted-recipient fixture alongside its unchanged group-cap controls.
* perf(agents): skip disabled debug preparation Punchcard-Session: clear-workshop-brook-w2 * fix(agents): keep disabled-debug optimization within line budget Punchcard-Session: ember-river-harbor-t4
Current qualification head:
7f8f144472c003291d8e262e9c24aa13ad5928e3. Integrated current main and corrected the inherited planner-test assumptions about job-level two-worker caps. Production scheduling is unchanged. Four focused cases and all 81 planner tests passed; fresh scoped P0–P2 review is clean. Prior CPU proof remains source-bound; fresh integrated-head CI and native qualification are pending.What Problem This Solves
Agent stream setup resolves cache retention and serializes parameter diagnostics even when debug logging is disabled.
User Impact
Disabled-debug requests avoid that diagnostic work. Stream options, per-call cache retention, and debug output when either logging sink is enabled stay unchanged. No configuration or data migration is required.
Why This Change Was Made
Gate diagnostic preparation with the existing logger enablement check. The regression uses the actual wrapper and logging configuration, verifies every stream completes, and checks file and console sinks across logging changes. Production line count is unchanged; the remaining changes are regression coverage and two logger fixtures.
The follow-up simplifies diagnostic object construction while preserving JSON output and the existing logging guard. This removes the two-line growth rejected by CI without changing tests or weakening the line-cap check.
Evidence
49808d12e106994cdb7911424ec75a2543017c5c.84660e59bc09a3496b387cc0235a745febe6c027ae037149d1a2886dfbc2fecd.Primed construction improved; first-call latency and full-lifetime peak RSS did not. Measurements exclude imports/setup and cover wrapper construction with synthetic streams. RSS is a worker process lifetime peak, not phase allocation or process-tree memory. These results establish no end-to-end Gateway or hosting speedup. New-head hosted CI and native landing gates remain pending.
Punchcard-Session: clear-workshop-brook-w2
Punchcard-Session: ember-river-harbor-t4