← Back to PRs

#20868: fix: resolve {model} responsePrefix vars in non-agent-turn paths

by Operative-001 open 2026-02-19 11:02 View on GitHub →
size: S trusted-contributor
## Summary - seed responsePrefix template context with the agent default model/provider at context creation time - keep runtime onModelSelected override behavior unchanged for agent-turn paths - add regression tests for both default seeding and runtime override updates ## Problem messages.responsePrefix templates like [{model}] could remain unresolved in non-agent-turn reply paths that never invoke onModelSelected. ## Fix Initialize prefixContext with resolveDefaultModelForAgent() so {model}, {provider}, and {modelFull} are available before runtime model selection callbacks fire. ## Validation - npm test -- src/channels/reply-prefix.test.ts <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixes unresolved template variables in responsePrefix for non-agent-turn reply paths by seeding the prefix context with default model info at creation time. Also adds a `delayMs` option to `process send-keys` for paced PTY writes. **Key changes:** - `reply-prefix.ts`: Seeds `prefixContext` with default model/provider/thinkingLevel at initialization using `resolveDefaultModelForAgent()` - `reply-prefix.test.ts`: Adds regression tests for both default seeding and runtime override behavior - `bash-tools.process.ts`: Adds optional `delayMs` parameter to pace key token writes in PTY sessions (max 5000ms) - `bash-tools.process.send-keys.e2e.test.ts`: Adds timing validation test for the paced write feature <h3>Confidence Score: 5/5</h3> - Safe to merge - well-tested bug fix with comprehensive regression tests - The PR addresses a clear bug (unresolved template vars in non-agent-turn paths) with a clean solution that seeds default values at initialization. Both changes have good test coverage - regression tests validate the fix works, and E2E tests confirm the paced write feature. The implementation follows existing patterns and doesn't introduce breaking changes. - No files require special attention <sub>Last reviewed commit: 655a106</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs