Repository navigation
refactor(ai): unify Responses transport factories - #114357
Conversation
8400182 to
642b35f
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 2:24 AM ET / 06:24 UTC. ClawSweeper reviewWhat this changesThe PR replaces separate OpenAI and Azure Responses streaming factory bodies with one configurable executor while retaining the two public wrapper entry points. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep open. This is an active, maintainer-labeled AI transport refactor; the supplied evidence shows exact-head OpenAI live coverage, but the shared executor also changes Azure execution and no approved Azure live proof or explicit AI-area acceptance of that gap is established here. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's AI transport layer turns a selected model, conversation context, and provider-specific options into a streamed assistant response. The OpenAI and Azure Responses entry points share most stream processing but retain different client construction, deployment, pricing, and timeout behavior. flowchart LR
A[Selected model and context] --> B[OpenAI or Azure wrapper]
B --> C[Shared Responses executor]
C --> D[Provider-specific client and request]
D --> E[Responses event stream]
E --> F[Assistant message and usage output]
Decision needed
Why: The patch intentionally centralizes execution used by Azure, but the available validation environment cannot exercise an Azure deployment; accepting that coverage boundary is a release-risk judgment rather than a mechanical code change. Before merge
Agent review detailsSecurityNone. PR surfaceSource -76. Total -76 across 1 file. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the two public wrappers and land the consolidation only after a redacted Azure real-provider transcript is added or an AI-area owner explicitly accepts the bounded Azure proof gap. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a refactor rather than a report of broken behavior; the relevant question is whether both existing provider paths preserve their runtime contracts. Is this the best way to solve the issue? Unclear: consolidating converged execution is a maintainable direction, but the best-fix judgment remains incomplete until Azure-specific runtime behavior is demonstrated or an AI-area owner accepts the missing live proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 604f37920310. 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
HistoryReview history (1 earlier review cycle)
|
|
ClawSweeper rank-up move — explicit owner decision: Peter Steinberger ( The accepted proof boundary is narrow: the Azure factory remains a signature-identical thin wrapper over the same shared executor exercised by the 4/4 exact-head live OpenAI Responses tests already documented on this PR. The provider-specific Azure construction, deployment resolution, request options, pricing, and first-event timeout remain passed into that executor through the existing wrapper configuration and are covered by the focused Azure/provider tests. This explicitly satisfies ClawSweeper's documented alternative rank-up move, "obtain explicit AI-area owner acceptance of the scoped proof gap." Exact-head hosted CI is green in run 30241490726. |
|
Merged via squash.
|
* origin/main: refactor(ai): unify Responses transport factories (openclaw#114357)
* refactor(ai): unify Responses transport factories * style(ai): format Responses transport executor
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
The AI package maintained parallel OpenAI Responses transport factories whose setup and execution behavior had converged. Keeping two implementations increased the chance of retry, stream-observation, or request-option behavior drifting between otherwise signature-compatible entry points.
Why This Change Was Made
This introduces one
createResponsesTransportExecutorimplementation and leaves the existing public wrappers thin and signature-compatible. The executor preserves the current differences between OpenAI and Azure: output API labeling, deployment resolution, streaming request hints, response creation, pricing, and Azure's default first-event timeout. The newer stream-observation and reasoning-replay metadata behavior frommainis shared by both paths.User Impact
No intended user-visible behavior change. Both Responses transport entry points retain their signatures and behavior with 76 fewer lines of duplicate implementation on the current layout.
Evidence
8199fbbfebf969218e7d92f57707c00591508e6e.gpt-5.6-luna.node scripts/check-changed.mjspassed on Blacksmith Testbox.codex-rs/codex-api/src/sse/responses.rs:34andcodex-rs/core/src/client.rs:1940inopenai/codex.