mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 21:00:30 +00:00
fix(coding-agent): add PR attribution to ctx.shutdown() changelog, fix example comments
This commit is contained in:
parent
6845c4b85e
commit
baf6fe4b39
2 changed files with 9 additions and 9 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
- Extension UI dialogs (`ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`) now support a `timeout` option with live countdown display ([#522](https://github.com/badlogic/pi-mono/pull/522) by [@nicobailon](https://github.com/nicobailon))
|
- Extension UI dialogs (`ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`) now support a `timeout` option with live countdown display ([#522](https://github.com/badlogic/pi-mono/pull/522) by [@nicobailon](https://github.com/nicobailon))
|
||||||
- Extensions can now provide custom editor components via `ctx.ui.setEditorComponent()`. See `examples/extensions/modal-editor.ts` and `docs/tui.md` Pattern 7.
|
- Extensions can now provide custom editor components via `ctx.ui.setEditorComponent()`. See `examples/extensions/modal-editor.ts` and `docs/tui.md` Pattern 7.
|
||||||
- Extension factories can now be async, enabling dynamic imports and lazy-loaded dependencies ([#513](https://github.com/badlogic/pi-mono/pull/513) by [@austinm911](https://github.com/austinm911))
|
- Extension factories can now be async, enabling dynamic imports and lazy-loaded dependencies ([#513](https://github.com/badlogic/pi-mono/pull/513) by [@austinm911](https://github.com/austinm911))
|
||||||
- `ctx.shutdown()` is now available in extension contexts for requesting a graceful shutdown. In interactive mode, shutdown is deferred until the agent becomes idle (after processing all queued steering and follow-up messages). In RPC mode, shutdown is deferred until after completing the current command response. In print mode, shutdown is a no-op as the process exits automatically when prompts complete.
|
- `ctx.shutdown()` is now available in extension contexts for requesting a graceful shutdown. In interactive mode, shutdown is deferred until the agent becomes idle (after processing all queued steering and follow-up messages). In RPC mode, shutdown is deferred until after completing the current command response. In print mode, shutdown is a no-op as the process exits automatically when prompts complete. ([#542](https://github.com/badlogic/pi-mono/pull/542) by [@kaofelix](https://github.com/kaofelix))
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export default function (pi: ExtensionAPI) {
|
||||||
pi.registerCommand("quit", {
|
pi.registerCommand("quit", {
|
||||||
description: "Exit pi cleanly",
|
description: "Exit pi cleanly",
|
||||||
handler: async (_args, ctx) => {
|
handler: async (_args, ctx) => {
|
||||||
await ctx.shutdown();
|
ctx.shutdown();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -25,12 +25,12 @@ export default function (pi: ExtensionAPI) {
|
||||||
parameters: Type.Object({}),
|
parameters: Type.Object({}),
|
||||||
async execute(_toolCallId, _params, _onUpdate, ctx, _signal) {
|
async execute(_toolCallId, _params, _onUpdate, ctx, _signal) {
|
||||||
// Do any final work here...
|
// Do any final work here...
|
||||||
// Then shutdown
|
// Request graceful shutdown (deferred until agent is idle)
|
||||||
await ctx.shutdown();
|
ctx.shutdown();
|
||||||
|
|
||||||
// This return won't be reached, but required by type
|
// This return is sent to the LLM before shutdown occurs
|
||||||
return {
|
return {
|
||||||
content: [{ type: "text", text: "Shutting down..." }],
|
content: [{ type: "text", text: "Shutdown requested. Exiting after this response." }],
|
||||||
details: {},
|
details: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -50,12 +50,12 @@ export default function (pi: ExtensionAPI) {
|
||||||
// Example deployment logic
|
// Example deployment logic
|
||||||
// const result = await pi.exec("npm", ["run", "deploy", params.environment], { signal });
|
// const result = await pi.exec("npm", ["run", "deploy", params.environment], { signal });
|
||||||
|
|
||||||
// On success, shutdown
|
// On success, request graceful shutdown
|
||||||
onUpdate?.({ content: [{ type: "text", text: "Deployment complete, exiting..." }], details: {} });
|
onUpdate?.({ content: [{ type: "text", text: "Deployment complete, exiting..." }], details: {} });
|
||||||
await ctx.shutdown();
|
ctx.shutdown();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: [{ type: "text", text: "Done!" }],
|
content: [{ type: "text", text: "Done! Shutdown requested." }],
|
||||||
details: { environment: params.environment },
|
details: { environment: params.environment },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue