Repository navigation
fix(combos): absorb community failover fixes (#7317, #7329, #7339, #7320) #7355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
949fe35
a598567
ddae975
92702ad
9ad40b2
c924a99
ed03dbb
afc1d9d
55a51b8
a86f24b
3a4b3f9
9922cb3
2f9066b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ import { | |
| } from "../../combos"; | ||
| import { formatErrorResponse } from "../../bridge"; | ||
| import { SEND_BUDGET_EXHAUSTED_CODE } from "../../lib/errors"; | ||
| import { redactSecretString, sanitizeLogMetadataString } from "../../lib/redact"; | ||
| import { | ||
| expandPreviousResponseInput, | ||
| previousResponseReplayFailure, | ||
|
|
@@ -1195,8 +1196,15 @@ export async function executeComboResponses( | |
| } | ||
| return lastFailure; | ||
| } | ||
| // A bare status made a revoked credential read as a provider outage. Log only the parsed | ||
| // code and message, never the raw envelope, as one redacted, bounded line. | ||
| const failureReason = sanitizeLogMetadataString( | ||
| redactSecretString([failure.upstreamCode, failure.upstreamMessage].filter(Boolean).join(": ")).replace(/\s+/g, " "), | ||
| 200, | ||
| ); | ||
|
Comment on lines
+1201
to
+1204
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '450,480p' AGENTS.md
sed -n '40,140p' src/server/responses/core-combo-failure.tsRepository: lidge-jun/opencodex Length of output: 6645 🏁 Script executed: printf '%s\n' '--- AGENTS.md privacy guidance ---'
nl -ba AGENTS.md | sed -n '455,472p'
printf '%s\n' '--- producer imports and complete function ---'
nl -ba src/server/responses/core-combo-failure.ts | sed -n '1,155p'
printf '%s\n' '--- normalization binding ---'
rg -n -F -- 'normalizeUpstreamErrorText' src
printf '%s\n' '--- warning branch ---'
nl -ba src/server/responses/core-combo.ts | sed -n '1188,1212p'Repository: lidge-jun/opencodex Length of output: 12903 🏁 Script executed: nl -ba src/server/responses/core-errors.ts | sed -n '1,145p'
nl -ba src/server/responses/core-errors.ts | sed -n '145,230p'Repository: lidge-jun/opencodex Length of output: 9692 Do not log the unallowlisted provider message.
Suggested fix--- "a/src/server/responses/core-combo.ts"
+++ "b/src/server/responses/core-combo.ts"
@@ -1198,14 +1198,10 @@
}
// A bare status made a revoked credential read as a provider outage. Log only the parsed
// code and message, never the raw envelope, as one redacted, bounded line.
- const failureReason = sanitizeLogMetadataString(
- redactSecretString([failure.upstreamCode, failure.upstreamMessage].filter(Boolean).join(": ")).replace(/\s+/g, " "),
- 200,
- );
console.warn(
`[combo] ${comboId}: ${targetKey(pick.target)} failed with ${failure.response.status}`
- + ` after ${Date.now() - started}ms${failureReason ? `: ${failureReason}` : ""}`,
+ + ` after ${Date.now() - started}ms`,
);
const failureNow = Date.now();
const attemptedTargets = pick.attempted;
const failureCooldownScope = comboFailureCooldownScope(failure.response.status, failure.classificationText, {🤖 Prompt for AI Agents |
||
| console.warn( | ||
| `[combo] ${comboId}: ${targetKey(pick.target)} failed with ${failure.response.status} after ${Date.now() - started}ms`, | ||
| `[combo] ${comboId}: ${targetKey(pick.target)} failed with ${failure.response.status}` | ||
| + ` after ${Date.now() - started}ms${failureReason ? `: ${failureReason}` : ""}`, | ||
| ); | ||
| const failureNow = Date.now(); | ||
| const attemptedTargets = pick.attempted; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a provider echoes submitted prompt text, tool arguments, or account details in a structured
error.message, this appends that attacker/provider-controlled content directly to the server log.redactSecretStringonly masks recognized credential patterns, while whitespace normalization and the 200-character cap do not prevent disclosure of ordinary request content or identifiers. Log a fixed classification or an allowlisted code instead of the raw upstream message.AGENTS.md reference: AGENTS.md:L463-L464
Useful? React with 👍 / 👎.