← Back to PRs

#7063: fix: update callers of createSystemPromptOverride to match new API

by MohammadErfan-Jabbari open 2026-02-02 10:34 View on GitHub →
agents size: XS
Fixes TS2349 compilation errors in pi-embedded-runner. ## Problem The recent commit b8174decf changed `createSystemPromptOverride` to return a function `(defaultPrompt?: string) => string` instead of returning a string directly. However, the call sites and tests weren't updated, causing TypeScript compilation errors: - TS2349 in `src/agents/pi-embedded-runner/compact.ts` around line 403 - TS2349 in `src/agents/pi-embedded-runner/run/attempt.ts` around line 393 ## Changes - **compact.ts**: Pass the function directly to `applySystemPromptOverrideToSession` instead of calling it first (the function accepts both string and function types) - **attempt.ts**: No changes needed - code was already correct (calls the function to get the string) - **test**: Update test expectations to call the returned function ## Testing - TypeScript compilation should pass without TS2349 errors - Existing tests updated to match new API <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates Pi embedded-runner call sites and tests for the `createSystemPromptOverride` API change (now returning a function rather than a string). In `compact.ts`, the override function is passed through to `applySystemPromptOverrideToSession` instead of being invoked immediately, and the unit test is updated to assert against `override()`. Overall this aligns callers with the new API and should resolve the TS2349 compilation errors described, while keeping runtime behavior the same (system prompt override is still a trimmed string). <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge; changes are narrowly scoped to API adaptation and tests. - The edits are small and local (one call-site change plus test expectation updates) and match the intended new return type of `createSystemPromptOverride`. The remaining concern is that `applySystemPromptOverrideToSession` currently invokes override functions without passing a default prompt, which could make the new `(defaultPrompt?: string)` signature less useful going forward. - src/agents/pi-embedded-runner/system-prompt.ts <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs