#7063: fix: update callers of createSystemPromptOverride to match new API
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
#14602: fix(plugins): hook systemPrompt gets collected then thrown away (#1...
by yinghaosang · 2026-02-12
79.8%
#21271: fix(commands): pass channel/capabilities/shell/os to runtime in com...
by evansantos · 2026-02-19
77.6%
#12871: fix: use bash and warn about shell injection (issue #12836)
by ambicuity · 2026-02-09
76.3%
#9273: Add files via upload
by cyrilliu1974 · 2026-02-05
76.2%
#23736: fix(system-prompt): improve prompt cache locality with unique agent ID
by mrx-arafat · 2026-02-22
75.6%
#17221: fix(agents): prevent agents from using exec for gateway management
by CornBrother0x · 2026-02-15
75.6%
#8961: feat: smarter compaction tool truncation + token count in system pr...
by SocialNerd42069 · 2026-02-04
75.6%
#11921: feat(hooks): support systemPrompt injection in before_agent_start hook
by jungdaesuh · 2026-02-08
75.4%
#6603: fix: use allowAny flag instead of size check for model override val...
by gavinbmoore · 2026-02-01
74.4%
#22705: fix(agents): merge before_agent_start hook systemPrompt into sessio...
by mushuiyu422 · 2026-02-21
74.1%