Repository navigation
fix(moonshot): forward abort signal through Kimi web search provider - #105125
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:43 PM ET / 19:43 UTC. ClawSweeper reviewWhat this changesThe PR forwards an agent run’s existing abort signal through Moonshot’s Kimi web-search plugin to the guarded outgoing HTTP request, with an in-flight cancellation regression test. Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherMoonshot’s Kimi plugin converts a web-search tool call into a Kimi chat-completions request through OpenClaw’s SSRF-guarded web-search HTTP helper. The agent runtime supplies an optional cancellation signal to the tool, which the shared helper already knows how to carry to the request. flowchart LR
A[Agent run cancellation] --> B[Web-search tool context]
B --> C[Moonshot Kimi plugin]
C --> D[Kimi search runtime]
D --> E[Guarded HTTP endpoint]
E --> F[Kimi chat completions]
F --> G[Search result or cancellation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +17. Total +23 across 3 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land this focused owner-boundary repair after exact-head CI completes, retaining the existing guarded transport seam and the colocated cancellation regression. Do we have a high-confidence way to reproduce the issue? Yes. Current source shows the execution signal is discarded at the Kimi facade before the shared HTTP helper, and the PR body includes before/after real proxy evidence for pre-aborted and in-flight requests. Is this the best way to solve the issue? Yes. The patch follows the existing public execution context and guarded HTTP transport contract, matching sibling provider behavior without adding configuration, fallback policy, or a parallel transport abstraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2f92c17db6e3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
ddead3b to
3e66ede
Compare
|
@clawsweeper re-review All R2 findings fixed (R3): P1 — Real in-flight cancel proof. Added live in-flight abort test: dispatches real Kimi web search, aborts mid-flight at ~500ms via P1 — Regression test protects the fix (control-red). Rewrote the signal-forwarding test: the mock captures the signal passed to P2 — Fixed false-positive sentinel. Removed the P2 — Assert signal reaches fetch. Unit test now captures Verification:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3e66ede to
5995f2a
Compare
|
@clawsweeper re-review P2 fixed — live proof now requires cancellation observation:
Verification:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review P2 fixed — opengrep This was likely why the R3 verdict never wrote back — the opengrep check failed, blocking the durable review comment edit. R4 commit Verification:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
fe38485 to
5c4b4b9
Compare
|
Maintainer verification through the same actual production Kimi provider -> SSRF-guarded HTTP -> real localhost HTTP CONNECT proxy, before/current The original human author and July 12 authored date are preserved. Scope remains exactly two original Kimi production owner modules (+8/-2 production lines) plus one existing colocated regression (+37/-20 test lines). The redundant 212-line standalone proof file was removed; the existing unsafe local environment-mutation helper was replaced with canonical SDK Moonshot, Google, and SearXNG focused owner/sibling regressions: 60 tests passed. Fresh final full-commit |
5c4b4b9 to
f36b812
Compare
f36b812 to
76841d2
Compare
|
Merged via squash.
|
What Problem This Solves
Cancelling an agent run does not cancel its Kimi (Moonshot) web-search HTTP request. The Kimi provider drops the execution context at its owner boundary, so both an already-aborted run and an in-flight cancellation can still complete a network request after the caller has stopped.
Why This Change Was Made
Forward the existing optional execution
AbortSignalthrough the original Kimi provider owner modules:createTool.execute(args, context)->executeKimiWebSearchProviderTool->runKimiSearch-> the existing trusted, SSRF-guarded web-search endpoint. This matches sibling Google and SearXNG providers; no new config, fallback, cache behavior, timeout policy, auth behavior, or SDK surface is introduced.User Impact
An already-cancelled Kimi search makes no upstream request. Cancelling a search already in flight promptly rejects the real HTTP request with the caller's original abort reason. Normal and cached search behavior are unchanged.
Evidence
Maintainer independently ran the identical actual production Kimi provider and SSRF-guarded HTTP path against a real localhost HTTP CONNECT proxy, both on current
mainand this refreshed contributor head:{"version":"before","mode":"preaborted","callerAborted":true,"upstreamRequests":1,"tunnels":1,"status":"completed","provider":"kimi"} {"version":"before","mode":"inflight","callerAborted":true,"upstreamRequests":1,"tunnels":2,"status":"completed","provider":"kimi"} {"version":"after","mode":"preaborted","callerAborted":true,"upstreamRequests":0,"tunnels":0,"status":"rejected","error":"caller-cancelled-before-request"} {"version":"after","mode":"inflight","callerAborted":true,"upstreamRequests":1,"tunnels":1,"status":"rejected","error":"caller-cancelled-during-request"}Real proxy tunnels, production provider execution, production SSRF guard, and production HTTP dispatcher were used; no mocked gateway, external API credentials, or paid API traffic.
Focused owner + sibling provider regression command:
Result: 60 passing tests across 3 files and 2 Vitest shards. Targeted existing repository
oxlintalso passes for the colocated regression.Fresh independent structured review:
.agents/skills/autoreview/scripts/autoreview --mode commit --commit HEAD --engine codex --thinking xhigh—gpt-5.6-sol, clean, confidence 0.99.The refreshed patch intentionally retains only the two original production owner modules and one existing colocated regression test (+8/-2 production lines, +37/-20 test lines). The redundant 212-line standalone proof file was removed; the pre-existing unsafe local environment-mutation helper was replaced by the canonical existing SDK
withEnvhelper because the hosted security scanner correctly rejects that old helper when the file changes. Original human contributor and July 12 authored date are preserved.