mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-26 09:54:19 +01:00
Defaults name current models, and review stops reading "the HIGH branch" as a HIGH finding (GST-3462) (#4678)
Three defaults gstack picks now name current models, and a reviewer's mention of a code name like "the HIGH branch" no longer becomes a HIGH finding. Why: our rule is no older-generation model in a role we choose, and the review parser forced a ruling on two notes that only quoted code. Nothing to do: no settings change; overrides work as before. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/adversarial-native#1 reader=adversarial-native Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/adversarial-native#5 reader=adversarial-native Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/adversarial-native#6 reader=adversarial-native Review-Finding: p1/outside-voice#3 reader=outside-voice
This commit is contained in:
1 parent
24b15c6823
commit
8ffd2b85f1
9 files changed
+131
-19
No files matched your search
@@ -75,6 +75,9 @@ export function parseGeminiStreamJson(raw: string): GeminiStreamParse {
|
||||
return { output, tokens: { input, output: out }, toolCalls, modelUsed };
|
||||
}
|
||||
|
||||
/** The model a run is labelled and priced as when the Gemini CLI reports none (its own default is not passed to us). */
|
||||
export const GEMINI_UNREPORTED_MODEL = 'gemini-4-argon';
|
||||
|
||||
/**
|
||||
* Map a raw stream-json dump to a RunResult, including the empty-success
|
||||
* hardening from #2159. Exported so adapter e2e can exercise the full
|
||||
@@ -85,7 +88,7 @@ export function resultFromGeminiStream(
|
||||
opts: { model?: string; durationMs?: number } = {},
|
||||
): RunResult {
|
||||
const parsed = parseGeminiStreamJson(raw);
|
||||
const modelUsed = parsed.modelUsed || opts.model || 'gemini-2.5-pro';
|
||||
const modelUsed = parsed.modelUsed || opts.model || GEMINI_UNREPORTED_MODEL;
|
||||
const durationMs = opts.durationMs ?? 0;
|
||||
if (!parsed.output.trim()) {
|
||||
return {
|
||||
@@ -180,7 +183,7 @@ export class GeminiAdapter implements ProviderAdapter {
|
||||
}
|
||||
|
||||
estimateCost(tokens: { input: number; output: number; cached?: number }, model?: string): number {
|
||||
return estimateCostUsd(tokens, model ?? 'gemini-2.5-pro');
|
||||
return estimateCostUsd(tokens, model ?? GEMINI_UNREPORTED_MODEL);
|
||||
}
|
||||
|
||||
private emptyResult(durationMs: number, error: RunResult['error'], model?: string): RunResult {
|
||||
@@ -189,7 +192,7 @@ export class GeminiAdapter implements ProviderAdapter {
|
||||
tokens: { input: 0, output: 0 },
|
||||
durationMs,
|
||||
toolCalls: 0,
|
||||
modelUsed: model ?? 'gemini-2.5-pro',
|
||||
modelUsed: model ?? GEMINI_UNREPORTED_MODEL,
|
||||
error,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user