fix: custom footer extensions now see model changes

This commit is contained in:
Ogulcan Celik 2026-01-11 21:26:04 +03:00
parent 3eb91d223f
commit e68058cc4f
2 changed files with 5 additions and 1 deletions

View file

@ -12,6 +12,7 @@
### Fixed
- Session picker respects custom keybindings when using `--resume` ([#633](https://github.com/badlogic/pi-mono/pull/633) by [@aos](https://github.com/aos))
- Custom footer extensions now see model changes: `ctx.model` is now a getter that returns the current model instead of a snapshot from when the context was created ([#634](https://github.com/badlogic/pi-mono/pull/634) by [@ogulcancelik](https://github.com/ogulcancelik))
## [0.42.5] - 2026-01-11

View file

@ -307,13 +307,16 @@ export class ExtensionRunner {
* Context values are resolved at call time, so changes via initialize() are reflected.
*/
createContext(): ExtensionContext {
const getModel = this.getModel;
return {
ui: this.uiContext,
hasUI: this.hasUI(),
cwd: this.cwd,
sessionManager: this.sessionManager,
modelRegistry: this.modelRegistry,
model: this.getModel(),
get model() {
return getModel();
},
isIdle: () => this.isIdleFn(),
abort: () => this.abortFn(),
hasPendingMessages: () => this.hasPendingMessagesFn(),