fix(fireworks): disable FirePass Kimi reasoning leak#63607
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟡 Fireworks Kimi thinking-disable wrapper can be bypassed via onPayload reintroducing reasoning fields
Description
This means a caller (or downstream wrapper) can undo the sanitization by re-adding Vulnerable flow:
Vulnerable code: onPayload: (payload) => {
if (payload && typeof payload === "object") {
patchPayload(payload as Record<string, unknown>);
}
return originalOnPayload?.(payload, model);
},RecommendationEnsure the enforced patch cannot be undone by user callbacks. Option A (enforce after user hook): onPayload: (payload) => {
const result = originalOnPayload?.(payload, model);
if (payload && typeof payload === "object") {
patchPayload(payload as Record<string, unknown>);
}
return result;
},Option B (stronger isolation): clone before invoking Also consider documenting the contract: whether Analyzed PR: #63607 at commit Last updated on: 2026-04-09T08:50:42Z |
Greptile SummaryThis PR fixes a visible reasoning leak in the Fireworks Kimi K2.5 provider: Fireworks can return chain-of-thought in visible The change is well-scoped, correctly implemented, and covered by focused unit tests on both the catalog metadata path and the stream wrapper path. Confidence Score: 5/5Safe to merge — all changes are correctly scoped to the Fireworks extension with no shared transport side effects. No P0 or P1 findings. The stream wrapper, catalog metadata, and dynamic model resolution all correctly disable thinking for Kimi models and pass through everything else. The one observation (indirect constant expression in provider-catalog.ts) is a P2 style suggestion that does not affect correctness. No files require special attention.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e2178525a
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1468d317aa
ℹ️ 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".
| ctx: ProviderWrapStreamFnContext, | ||
| ): StreamFn | undefined { | ||
| if ( | ||
| ctx.provider !== "fireworks" || |
There was a problem hiding this comment.
Apply Fireworks hardening for provider aliases too
wrapFireworksProviderStream exits unless ctx.provider === "fireworks", but this provider explicitly supports aliases (aliases: ["fireworks-ai"] in extensions/fireworks/index.ts). The hook is still resolved for aliases, so requests configured under fireworks-ai skip this wrapper and won’t get thinking: { type: "disabled" } or reasoning-field stripping, leaving the reasoning-leak path unfixed for a supported provider id.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
* fix: disable FirePass Kimi reasoning leak * fix: preserve Fireworks wrapper fallbacks * fix: harden Fireworks Kimi model matching * fix: restore Fireworks payload sanitization
* fix: disable FirePass Kimi reasoning leak * fix: preserve Fireworks wrapper fallbacks * fix: harden Fireworks Kimi model matching * fix: restore Fireworks payload sanitization
* fix: disable FirePass Kimi reasoning leak * fix: preserve Fireworks wrapper fallbacks * fix: harden Fireworks Kimi model matching * fix: restore Fireworks payload sanitization
* fix: disable FirePass Kimi reasoning leak * fix: preserve Fireworks wrapper fallbacks * fix: harden Fireworks Kimi model matching * fix: restore Fireworks payload sanitization
* fix: disable FirePass Kimi reasoning leak * fix: preserve Fireworks wrapper fallbacks * fix: harden Fireworks Kimi model matching * fix: restore Fireworks payload sanitization
* fix: disable FirePass Kimi reasoning leak * fix: preserve Fireworks wrapper fallbacks * fix: harden Fireworks Kimi model matching * fix: restore Fireworks payload sanitization
Summary
contentwhen OpenClaw sends the normal OpenAI-compatible payload.reasoning: false, and the Fireworks provider wrapper forcesthinking: { type: "disabled" }while stripping reasoning fields before the request is sent.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
contentunlessthinkingis explicitly disabled, while the bundled Fireworks provider still advertised Kimi as reasoning-enabled and forwarded reasoning settings.reasoning: false, but the bundled provider catalog and dynamic-model path had drifted from that expectation.Regression Test Plan (if applicable)
extensions/fireworks/stream.test.ts,extensions/fireworks/index.test.tsthinking: { type: "disabled" }, strip reasoning fields, and do not mark Kimi models as reasoning-enabled.src/agents/pi-embedded-runner/minimax-stream-wrappers.test.tscovers the adjacent hidden-thinking wrapper pattern.User-visible / Behavior Changes
thinking: { type: "disabled" }to prevent visible reasoning leakage.Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
accounts/fireworks/routers/kimi-k2p5-turboSteps
content.Expected
Actual
content.Evidence
Attach at least one:
Human Verification (required)
pnpm build/ full-suite gate in this worktree.Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
extensions/fireworks/model-id.tsand covered by focused tests.