Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions extensions/goal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Type } from "typebox";
import { sanitizeTerminalText } from "../shared/terminal-text.ts";
import {
OPENPI_TOOL_SURFACE,
loadOpenPiCapabilities,
patchOwnedTools,
} from "../shared/tool-surface.ts";
import { GOAL_CONTINUATION_TYPE, GoalController } from "./controller.ts";
Expand Down Expand Up @@ -96,10 +97,12 @@ export default function sessionGoal(pi: ExtensionAPI) {
patchOwnedTools(pi, "goal", {
disable: OPENPI_TOOL_SURFACE.goal.deferred,
});
const showLifecycleTools = () =>
patchOwnedTools(pi, "goal", {
const showLifecycleTools = () => {
loadOpenPiCapabilities(pi, ["session"]);
return patchOwnedTools(pi, "goal", {
enable: OPENPI_TOOL_SURFACE.goal.deferred,
});
};

const updateUi = (ctx: ExtensionContext) => {
if (!ctx.hasUI) return;
Expand Down Expand Up @@ -331,6 +334,7 @@ export default function sessionGoal(pi: ExtensionAPI) {
throw new Error(`Goal automation is disabled in ${ctx.mode} mode.`);
}
controller.resume();
showLifecycleTools();
controller.kickoff(ctx);
// Report the status AFTER kickoff: dispatching the first turn can
// change it (e.g. a dispatch failure pauses the goal), so notifying
Expand Down Expand Up @@ -428,6 +432,7 @@ export default function sessionGoal(pi: ExtensionAPI) {
);
if (shouldResume) {
controller.resume();
showLifecycleTools();
controller.kickoff(ctx);
}
}
Expand Down
Loading
Loading