GeezerVison is showing github.com — review prompt: friendly green callouts + per-section severity emojis … · pullfrog/pullfrog@ddbc610
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: agents/claude.ts +9-4Lines changed: 9 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -33,7 +33,11 @@ import { | 33 | 33 | import { ThinkingTimer } from "../utils/timer.ts"; | 34 | 34 | import type { TodoTracker } from "../utils/todoTracking.ts"; | 35 | 35 | import { getDevDependencyVersion } from "../utils/version.ts"; | 36 | | -import { buildLearningsReflectionPrompt, runPostRunRetryLoop } from "./postRun.ts"; | | 36 | +import { | | 37 | + buildLearningsReflectionPrompt, | | 38 | + runPostRunRetryLoop, | | 39 | + shouldRunReflection, | | 40 | +} from "./postRun.ts"; | 37 | 41 | import { REVIEWER_AGENT_NAME, REVIEWER_SYSTEM_PROMPT } from "./reviewer.ts"; | 38 | 42 | import { formatWithLabel, ORCHESTRATOR_LABEL, SessionLabeler } from "./sessionLabeler.ts"; | 39 | 43 | import { | @@ -966,9 +970,10 @@ export const claude = agent({ | 966 | 970 | ctx, | 967 | 971 | initialResult: result, | 968 | 972 | initialUsage: result.usage, | 969 | | - reflectionPrompt: ctx.toolState.learningsFilePath | 970 | | - ? buildLearningsReflectionPrompt(ctx.toolState.learningsFilePath) | 971 | | - : undefined, | | 973 | + reflectionPrompt: | | 974 | + ctx.toolState.learningsFilePath && shouldRunReflection(ctx.toolState.selectedMode) | | 975 | + ? buildLearningsReflectionPrompt(ctx.toolState.learningsFilePath) | | 976 | + : undefined, | 972 | 977 | canResume: (r) => Boolean(r.sessionId), | 973 | 978 | resume: async (c) => { | 974 | 979 | const sessionId = c.previousResult.sessionId; | |
Collapse file Copy file name to clipboard +34Lines changed: 34 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { describe, expect, it } from "vitest"; | | 2 | +import { modelAliases } from "../models.ts"; | | 3 | +import { geminiHighThinkingOverrides } from "./opencode.ts"; | | 4 | + | | 5 | +describe("geminiHighThinkingOverrides", () => { | | 6 | + // Expected truth pulled the same way the helper does — both must derive from | | 7 | + // the registry so the test exercises the wiring, not a hand-maintained list. | | 8 | + const expectedApiIds = modelAliases | | 9 | + .filter((a) => a.provider === "google") | | 10 | + .map((a) => a.resolve.replace(/^google\//, "")); | | 11 | + const overrides = geminiHighThinkingOverrides(); | | 12 | + | | 13 | + it("covers every direct-Google alias in the registry", () => { | | 14 | + expect(Object.keys(overrides).sort()).toEqual([...expectedApiIds].sort()); | | 15 | + }); | | 16 | + | | 17 | + it("is non-empty (catches accidental whole-provider removal)", () => { | | 18 | + expect(Object.keys(overrides).length).toBeGreaterThan(0); | | 19 | + }); | | 20 | + | | 21 | + it("strips the `google/` prefix from each resolve to get the bare API id", () => { | | 22 | + for (const id of Object.keys(overrides)) { | | 23 | + expect(id).not.toMatch(/^google\//); | | 24 | + } | | 25 | + }); | | 26 | + | | 27 | + it("pins every entry to thinkingLevel: high", () => { | | 28 | + for (const [id, value] of Object.entries(overrides)) { | | 29 | + expect(value, `entry for ${id}`).toEqual({ | | 30 | + options: { thinkingConfig: { thinkingLevel: "high" } }, | | 31 | + }); | | 32 | + } | | 33 | + }); | | 34 | +}); |
Collapse file Copy file name to clipboardExpand all lines: agents/opencode.ts +25-35Lines changed: 25 additions & 35 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,11 @@ import { | 39 | 39 | PULLFROG_OPENCODE_PLUGIN_FILENAME, | 40 | 40 | PULLFROG_OPENCODE_PLUGIN_SOURCE, | 41 | 41 | } from "./opencodePlugin.ts"; | 42 | | -import { buildLearningsReflectionPrompt, runPostRunRetryLoop } from "./postRun.ts"; | | 42 | +import { | | 43 | + buildLearningsReflectionPrompt, | | 44 | + runPostRunRetryLoop, | | 45 | + shouldRunReflection, | | 46 | +} from "./postRun.ts"; | 43 | 47 | import { REVIEWER_AGENT_NAME, REVIEWER_SYSTEM_PROMPT } from "./reviewer.ts"; | 44 | 48 | import { formatWithLabel, ORCHESTRATOR_LABEL, SessionLabeler } from "./sessionLabeler.ts"; | 45 | 49 | import { | @@ -95,24 +99,20 @@ type OpenCodeConfig = { | 95 | 99 | // on merge in session/llm.ts), so the env var is the only working knob. | 96 | 100 |
| 97 | 101 | /** | 98 | | - * upstream opencode hardcodes `thinkingLevel: "high"` as the default for every | 99 | | - * gemini-3 model on the direct google SDK (`provider/transform.ts` `options()`). | 100 | | - * that adds 30-60s of pre-tool-call TTFT and 5-46s of post-tool jabber per turn, | 101 | | - * which is overkill for agentic loops where most steps are tool-routing | 102 | | - * decisions. we override to "medium" for the curated slugs we ship in | 103 | | - * `action/models.ts`; users who want max quality can still pick the `-high` | 104 | | - * variant explicitly. flash stays at "medium" too — low-effort flash is | 105 | | - * visibly worse on harder tasks and the latency savings aren't meaningful | 106 | | - * (flash is already fast). other gemini-3 ids that exist in models.dev but | 107 | | - * aren't in our curated alias map keep the upstream `"high"` default. | 108 | | - * | 109 | | - * keyed by upstream api id (matches the slugs in `action/models.ts`). the | 110 | | - * merge order in opencode `session/llm.ts` is `base ← model.options ← agent.options ← variant`, | 111 | | - * deep-merged — so an explicit `--variant high` still wins, and explicit | 112 | | - * model.options in a user-provided opencode config would also win. | | 102 | + * Build the `provider.google.models[id].options` map that pins every direct-Google | | 103 | + * Gemini alias to `thinkingLevel: "high"`. Sourced from the model registry so | | 104 | + * adding/renaming a Google alias in `action/models.ts` flows through automatically. | 113 | 105 | */ | 114 | | -const GEMINI_3_DIRECT_THINKING_LEVEL = "medium"; | 115 | | -const GEMINI_3_DIRECT_API_IDS = ["gemini-3.1-pro-preview", "gemini-3-flash-preview"]; | | 106 | +export function geminiHighThinkingOverrides(): Record<string, { options: object }> { | | 107 | + return Object.fromEntries( | | 108 | + modelAliases | | 109 | + .filter((a) => a.provider === "google") | | 110 | + .map((a) => [ | | 111 | + a.resolve.replace(/^google\//, ""), | | 112 | + { options: { thinkingConfig: { thinkingLevel: "high" } } }, | | 113 | + ]) | | 114 | + ); | | 115 | +} | 116 | 116 |
| 117 | 117 | function buildSecurityConfig(ctx: AgentRunContext, model: string | undefined): string { | 118 | 118 | const config: OpenCodeConfig = { | @@ -142,20 +142,9 @@ function buildSecurityConfig(ctx: AgentRunContext, model: string | undefined): s | 142 | 142 | // the "Parallel tool execution" guidance in utils/instructions.ts so the | 143 | 143 | // model actually reaches for it. see wiki/prompt.md. | 144 | 144 | experimental: { batch_tool: true }, | 145 | | - provider: { | 146 | | - google: { | 147 | | - models: Object.fromEntries( | 148 | | - GEMINI_3_DIRECT_API_IDS.map((id) => [ | 149 | | - id, | 150 | | - { | 151 | | - options: { | 152 | | - thinkingConfig: { thinkingLevel: GEMINI_3_DIRECT_THINKING_LEVEL }, | 153 | | - }, | 154 | | - }, | 155 | | - ]) | 156 | | - ), | 157 | | - }, | 158 | | - }, | | 145 | + // gemini-3 thinking pinned to high for review depth; gpt and anthropic | | 146 | + // effort set elsewhere (gpt: upstream default, anthropic: --effort flag in claude.ts). | | 147 | + provider: { google: { models: geminiHighThinkingOverrides() } }, | 159 | 148 | }; | 160 | 149 |
| 161 | 150 | if (model) { | @@ -1304,9 +1293,10 @@ export const opencode = agent({ | 1304 | 1293 | ctx, | 1305 | 1294 | initialResult: result, | 1306 | 1295 | initialUsage: result.usage, | 1307 | | - reflectionPrompt: ctx.toolState.learningsFilePath | 1308 | | - ? buildLearningsReflectionPrompt(ctx.toolState.learningsFilePath) | 1309 | | - : undefined, | | 1296 | + reflectionPrompt: | | 1297 | + ctx.toolState.learningsFilePath && shouldRunReflection(ctx.toolState.selectedMode) | | 1298 | + ? buildLearningsReflectionPrompt(ctx.toolState.learningsFilePath) | | 1299 | + : undefined, | 1310 | 1300 | resume: async (c) => | 1311 | 1301 | runOpenCode({ | 1312 | 1302 | ...runParams, | |
Collapse file Copy file name to clipboardExpand all lines: agents/postRun.ts +19-1Lines changed: 19 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -158,7 +158,7 @@ export function buildUnsubmittedReviewPrompt(mode: "Review" | "IncrementalReview | 158 | 158 | return [ | 159 | 159 | `MISSING REVIEW OUTPUT — you selected Review mode but stopped without calling \`create_pull_request_review\`. the user has no visible signal that this run produced anything; the progress comment will be deleted on exit and no review will appear on the PR.`, | 160 | 160 | "", | 161 | | - "call `create_pull_request_review` now with your aggregated review (body + inline comments). pick the tier per the mode prompt — Review mode has no no-submit exit, so even informational `> [!NOTE]` reviews and `No new issues found.` reviews must be submitted (both use `approved: true`). the first call may error once with a diff-coverage nudge — retry the same call to proceed.", | | 161 | + "call `create_pull_request_review` now with your aggregated review (body + inline comments). pick the tier per the mode prompt — Review mode has no no-submit exit, so even informational `> ✅ No new issues found.` reviews must be submitted (with `approved: true`). the first call may error once with a diff-coverage nudge — retry the same call to proceed.", | 162 | 162 | "", | 163 | 163 | "do NOT stop again until `create_pull_request_review` has been called successfully.", | 164 | 164 | ].join("\n"); | @@ -243,6 +243,24 @@ export function buildPostRunPrompt(issues: PostRunIssues): string { | 243 | 243 | return parts.join("\n\n---\n\n"); | 244 | 244 | } | 245 | 245 |
| | 246 | +/** | | 247 | + * modes for which the post-run reflection turn is skipped. reflection costs a | | 248 | + * full resume turn (~$0.50-0.80 per run on Opus, mostly cache-write) and only | | 249 | + * pays for itself when the run actually produced novel, durable findings. | | 250 | + * | | 251 | + * `IncrementalReview` is the lowest-novelty mode — it's a tight delta review | | 252 | + * against an existing PR with the prior summary already loaded as context. | | 253 | + * the agent rarely discovers anything generalizable to next runs, so the | | 254 | + * reflection turn is dead weight. initial `Review` still touches fresh PR | | 255 | + * territory and benefits; `Build` / `Fix` / `AddressReviews` definitely do. | | 256 | + */ | | 257 | +const REFLECTION_SKIP_MODES: ReadonlySet<string> = new Set(["IncrementalReview"]); | | 258 | + | | 259 | +export function shouldRunReflection(mode: string | undefined): boolean { | | 260 | + if (!mode) return true; | | 261 | + return !REFLECTION_SKIP_MODES.has(mode); | | 262 | +} | | 263 | + | 246 | 264 | /** | 247 | 265 | * prompt for a dedicated post-run reflection turn nudging the agent to edit | 248 | 266 | * the rolling learnings file if it discovered anything worth persisting. | |
Collapse file Copy file name to clipboardExpand all lines: agents/subagentModels.test.ts +10-7Lines changed: 10 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -66,20 +66,23 @@ describe("deriveSubagentModels", () => { | 66 | 66 | }); | 67 | 67 | }); | 68 | 68 |
| 69 | | - describe("google (gemini) — pro → flash", () => { | 70 | | - it("direct google", () => { | | 69 | + describe("google (gemini) — inherit (Pro for both orchestrator and lenses)", () => { | | 70 | + // pro → flash was a meaningful capability cliff (Flash missed catastrophic | | 71 | + // cross-file bugs the v4 e2e test surfaced); Pro is cost-effective enough | | 72 | + // to keep on for lenses too. Google has no in-between tier. | | 73 | + it("direct google pro inherits", () => { | 71 | 74 | expect(deriveSubagentModels("google/gemini-3.1-pro-preview")).toEqual({ | 72 | | - reviewer: "google/gemini-3-flash-preview", | | 75 | + reviewer: undefined, | 73 | 76 | }); | 74 | 77 | }); | 75 | | - it("opencode-vendored gemini-pro", () => { | | 78 | + it("opencode-vendored gemini-pro inherits", () => { | 76 | 79 | expect(deriveSubagentModels("opencode/gemini-3.1-pro")).toEqual({ | 77 | | - reviewer: "opencode/gemini-3-flash", | | 80 | + reviewer: undefined, | 78 | 81 | }); | 79 | 82 | }); | 80 | | - it("openrouter-google-gemini-pro", () => { | | 83 | + it("openrouter gemini-pro inherits", () => { | 81 | 84 | expect(deriveSubagentModels("openrouter/google/gemini-3.1-pro-preview")).toEqual({ | 82 | | - reviewer: "openrouter/google/gemini-3-flash-preview", | | 85 | + reviewer: undefined, | 83 | 86 | }); | 84 | 87 | }); | 85 | 88 | it("flash has no downshift", () => { | |
Collapse file Copy file name to clipboardExpand all lines: gha.ts +23-1Lines changed: 23 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,8 +34,11 @@ config({ path: join(actionDir, ".env") }); | 34 | 34 | config({ path: join(repoRoot, ".env") }); | 35 | 35 |
| 36 | 36 | // host env vars that would actively conflict with the container's own | 37 | | -// configuration (paths, identity, shell). everything else passes through. | | 37 | +// configuration (paths, identity, shell, and outer-CI workflow-run identifiers | | 38 | +// that don't apply to whatever repo the harness is acting against). everything | | 39 | +// else passes through. | 38 | 40 | const HOST_ONLY_VARS = new Set([ | | 41 | + // paths / identity / shell — would clobber the container's testuser setup | 39 | 42 | "PATH", | 40 | 43 | "HOME", | 41 | 44 | "USER", | @@ -63,6 +66,25 @@ const HOST_ONLY_VARS = new Set([ | 63 | 66 | "COLORTERM", | 64 | 67 | "ITERM_PROFILE", | 65 | 68 | "ITERM_SESSION_ID", | | 69 | + // outer-CI workflow-run identifiers — when `pnpm runtest smoke` runs inside | | 70 | + // pullfrog/app's CI, these refer to pullfrog/app's run, NOT the test repo | | 71 | + // the harness is acting against (e.g. pullfrog/test-repo). Anything inside | | 72 | + // the action that uses them as keys to look up state on the test repo (most | | 73 | + // notably `resolveRun()`'s `actions.listJobsForWorkflowRun(...)` call) will | | 74 | + // 404. Filtering them here means the action sees them as undefined and | | 75 | + // skips the lookup, instead of misdirecting it. `GITHUB_REPOSITORY` and | | 76 | + // `GITHUB_TOKEN` are NOT filtered — those are genuinely needed inside. | | 77 | + "GITHUB_RUN_ID", | | 78 | + "GITHUB_RUN_NUMBER", | | 79 | + "GITHUB_RUN_ATTEMPT", | | 80 | + "GITHUB_JOB", | | 81 | + "GITHUB_WORKFLOW", | | 82 | + "GITHUB_ACTION", | | 83 | + "GITHUB_REF", | | 84 | + "GITHUB_SHA", | | 85 | + "GITHUB_HEAD_REF", | | 86 | + "GITHUB_BASE_REF", | | 87 | + "GITHUB_TRIGGERING_ACTOR", | 66 | 88 | ]); | 67 | 89 |
| 68 | 90 | type Args = { | |
Collapse file Copy file name to clipboardExpand all lines: mcp/review.ts +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -316,7 +316,7 @@ export const CreatePullRequestReview = type({ | 316 | 316 | .optional(), | 317 | 317 | approved: type.boolean | 318 | 318 | .describe( | 319 | | - "Set to true to submit as an approval. Use for both 'no issues found' and informational `> [!NOTE]` reviews where the PR is mergeable as-is and nothing in the body warrants code changes — approving also suppresses the Fix-button footer affordance so users don't dispatch a fix run on non-actionable feedback. Reserve approved: false for `> [!IMPORTANT]` (recommended changes) and `> [!CAUTION]` (critical) reviews. Defaults to false (comment-only review). Rejections are not supported." | | 319 | + "Set to true to submit as an approval. Use for `> ✅ No new issues found.` reviews where the PR is mergeable as-is and nothing in the body warrants code changes — approving also suppresses the Fix-button footer affordance so users don't dispatch a fix run on non-actionable feedback. Reserve approved: false for `> ℹ️ ...` (minor suggestions inline), `> [!IMPORTANT]` (recommended changes), and `> [!CAUTION]` (critical) reviews. Defaults to false (comment-only review). Rejections are not supported." | 320 | 320 | ) | 321 | 321 | .optional(), | 322 | 322 | commit_id: type.string | @@ -850,8 +850,8 @@ async function createAndSubmitWithFooter( | 850 | 850 | // introduce new throw paths. keep the whole body wrapped. | 851 | 851 | try { | 852 | 852 | // Fix buttons are suppressed on approving reviews — those are mergeable | 853 | | - // by definition (either "no issues found" or `> [!NOTE]` informational | 854 | | - // observations), so dispatching a fix run would be a UX trap. | | 853 | + // by definition (the `> ✅ No new issues found.` tier, with no inline | | 854 | + // comments), so dispatching a fix run would be a UX trap. | 855 | 855 | const customParts: string[] = []; | 856 | 856 | if (!opts.approved) { | 857 | 857 | const apiUrl = getApiUrl(); | |
Collapse file Copy file name to clipboardExpand all lines: models.ts +7-3Lines changed: 7 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -170,7 +170,11 @@ export const providers = { | 170 | 170 | resolve: "google/gemini-3.1-pro-preview", | 171 | 171 | openRouterResolve: "openrouter/google/gemini-3.1-pro-preview", | 172 | 172 | preferred: true, | 173 | | - subagentModel: "gemini-flash", | | 173 | + // Inherit (subagents stay on Pro). Google has no in-between tier; | | 174 | + // dropping to Flash for review work was a meaningful capability cliff | | 175 | + // (Flash missed the catastrophic camelCase/snake_case mismatch in | | 176 | + // the v4 e2e test). Pro is cost-effective enough to use for both | | 177 | + // orchestrator and lenses. | 174 | 178 | }, | 175 | 179 | "gemini-flash": { | 176 | 180 | displayName: "Gemini Flash", | @@ -319,7 +323,7 @@ export const providers = { | 319 | 323 | displayName: "Gemini Pro", | 320 | 324 | resolve: "opencode/gemini-3.1-pro", | 321 | 325 | openRouterResolve: "openrouter/google/gemini-3.1-pro-preview", | 322 | | - subagentModel: "gemini-flash", | | 326 | + // Inherit — see google/gemini-pro for rationale. | 323 | 327 | }, | 324 | 328 | "gemini-flash": { | 325 | 329 | displayName: "Gemini Flash", | @@ -432,7 +436,7 @@ export const providers = { | 432 | 436 | displayName: "Gemini Pro", | 433 | 437 | resolve: "openrouter/google/gemini-3.1-pro-preview", | 434 | 438 | openRouterResolve: "openrouter/google/gemini-3.1-pro-preview", | 435 | | - subagentModel: "gemini-flash", | | 439 | + // Inherit — see google/gemini-pro for rationale. | 436 | 440 | }, | 437 | 441 | "gemini-flash": { | 438 | 442 | displayName: "Gemini Flash", | |
|