Repository navigation
refactor(ai): keep model policy parsing independent of transport host - #142804
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: needs maintainer review before merge. Reviewed September 8, 2026, 11:41 PM ET / September 9, 2026, 03:41 UTC (Revision 2). ClawSweeper reviewWhat this changesMoves numeric parsing into a lightweight internal module so OpenAI model-policy inspection avoids loading the transport host, while preserving existing exports and adding regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused refactor: current main still has the unwanted dependency, and the patch preserves existing parsing behavior. No actionable correctness or security findings were identified. Priority: P3 Review scores
Verification
How this fits togetherOpenAI model policy uses model metadata and request parameters to determine supported request options and compaction thresholds. Its metadata readers share this policy with request construction, so their imports affect how much runtime code loads during inspection. flowchart LR
A[Model metadata and parameters] --> B[OpenAI model policy]
B --> C[Responses payload policy]
C --> D[Standalone integer parser]
C --> E[Capabilities and thresholds]
E --> F[Request construction]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +32. Total +33 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one shared parser behind a lightweight leaf import, preserving numeric coercion and existing caller exports. Do we have a high-confidence way to reproduce the issue? Yes for the import dependency: current main's metadata path reaches the transport host through the integer parser. Signal timing failures were not independently reproduced in this read-only review. Is this the best way to solve the issue? Yes. Moving the unchanged parser and preserving its existing export removes the dependency without duplicating policy or changing request semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f0f98ef7efe. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…1-prep * commit 'b04a3f83adad8bd6a2ca8408e7940fc6bcbde212': (636 commits) docs(cli): split the doctor command reference by reader job (openclaw#142855) fix(ui): explain paused weekly skill reviews (openclaw#142840) docs(automations): describe supported schedule options (openclaw#135964) fix(image): close registration resources after generation (openclaw#142843) fix(slack): keep ack reactions independent of status reactions (openclaw#142595) fix(ui): avoid flashes when switching cold sessions (openclaw#134868) refactor(tests): share independent no-queued-reply expectations (openclaw#142845) perf: reduce generated media reference formatting overhead (openclaw#142836) fix: sessions_yield keeps long transcript history available (openclaw#137381) fix(music): close registration resources after generation (openclaw#142834) fix: update confirmation shows stale commit counts after refresh (openclaw#142837) fix(ci): retain Android emulator post-timeout evidence (openclaw#142835) fix(talk): retain final delivery across delegation waves (openclaw#142830) docs(gateway): run Linux system services as the state owner (openclaw#136266) fix(models): align static Anthropic aliases with manifest (openclaw#137376) test(gateway): simplify session lifecycle gates and report early rollback failures (openclaw#142833) refactor(ai): keep model policy parsing independent of transport host (openclaw#142804) refactor: simplify interactive SDK forwarding (openclaw#142824) fix(cli): finish pending cleanup before automatic macOS exit (openclaw#142814) docs(memory-lancedb): clarify enforced compatibility ranges (openclaw#142827) ...
Related: #142682, #142738
What Problem This Solves
Resolves a problem where reading OpenAI model policy pulls in the AI transport host solely to parse a positive integer. The unnecessary dependency was found while investigating cold first-reply Signal test failures.
Why This Change Was Made
Move the exact existing parser into a private leaf module and have Responses payload policy import that leaf. The old transport-utils export remains available. An import-boundary regression prevents model-policy loading from depending on the transport host again.
User Impact
Model-policy inspection has a narrower dependency graph. Fast choices, model routes, numeric coercion, and existing public exports retain their behavior. No package exports, dependencies, versions, or configuration change.
Evidence
The import-boundary test failed on the original graph and passes after the change. The canonical five-path gate, ordinary build, and independent Codex review passed. Sixty-six focused tests cover the import boundary, Fast and route policy, Responses handling, and coercion. Rebuilt AI package exports and four native threshold cases also passed.
The original Signal CI shard passed on Linux with fresh caches and three workers: 48 files and 863 tests, without changing its assertions, timeouts, fixtures, or routing. The previously failing prefix case took 4.228 seconds; the cancellation case took 0.447 seconds. All temporary profiling changes were removed.
A causal comparison confirmed that the earlier Fast metadata import increased cold source-loader work. This patch removes a verified transport-host dependency, but residual source-test startup cost remains; these measurements do not establish a production latency improvement. The remote test runtime was Node 24.19, while the original CI failure used Node 24.20; the failure was also reproduced independently on the remote runtime.