refactor: fix kilo markers

This commit is contained in:
Catriel Müller
2026-06-29 17:00:36 -03:00
parent 9d9a5d06d6
commit 3f38c3f8fc
5 changed files with 14 additions and 9 deletions
+3 -1
View File
@@ -412,11 +412,13 @@ export const RunCommand = effectCmd({
action: "deny",
pattern: "*",
},
// kilocode_change start - non-interactive runs cannot take over a terminal
{
permission: "interactive_terminal", // kilocode_change - non-interactive runs cannot take over a terminal
permission: "interactive_terminal",
action: "deny",
pattern: "*",
},
// kilocode_change end
{
permission: "plan_enter",
action: "deny",
+3 -1
View File
@@ -570,9 +570,11 @@ export class RunFooter implements FooterApi {
? this.base + PERMISSION_ROWS
: type === "question"
? this.base + QUESTION_ROWS
: type === "interactive_terminal" // kilocode_change
// kilocode_change start
: type === "interactive_terminal"
? this.base + RUN_INTERACTIVE_TERMINAL_ROWS
: this.promptRoute.type === "command"
// kilocode_change end
? 1 + COMMAND_ROWS
: this.promptRoute.type === "model"
? 1 + MODEL_ROWS
@@ -217,16 +217,16 @@ function out(data: SessionData, commits: SessionCommit[], footer?: FooterOutput)
}
}
// kilocode_change start
export function pickBlockerView(input: {
permission?: PermissionRequest
question?: QuestionRequest
terminal?: RunInteractiveTerminalSnapshot // kilocode_change
terminal?: RunInteractiveTerminalSnapshot
}): FooterView {
// kilocode_change start
if (input.terminal) {
return { type: "interactive_terminal", terminal: input.terminal }
}
// kilocode_change end
// kilocode_change end
if (input.permission) {
return { type: "permission", request: input.permission }
@@ -1409,10 +1409,11 @@ export function Session() {
</For>
</scrollbox>
<box flexShrink={0}>
{/* kilocode_change - the terminal owns the input area while active */}
{/* kilocode_change start - the terminal owns the input area while active */}
<Show when={!terminal() && permissions().length > 0}>
<PermissionPrompt request={permissions()[0]} />
</Show>
{/* kilocode_change end */}
{/* kilocode_change start */}
<Show when={terminal()} keyed>
{(value) => <TerminalPrompt sessionID={value.info.sessionID} terminalID={value.info.id} />}
+3 -3
View File
@@ -74,7 +74,7 @@ it.instance("build agent has correct default properties", () =>
expect(evalPerm(build, "bash")).toBe("ask")
expect(evalPerm(build, "repo_clone")).toBe("deny")
expect(evalPerm(build, "repo_overview")).toBe("deny")
expect(evalPerm(build, "interactive_terminal")).toBe("allow")
expect(evalPerm(build, "interactive_terminal")).toBe("allow") // kilocode_change
}),
)
@@ -84,7 +84,7 @@ it.instance("plan agent denies edits except .opencode/plans/*", () =>
expect(plan).toBeDefined()
// Wildcard is denied
expect(evalPerm(plan, "edit")).toBe("deny")
expect(evalPerm(plan, "interactive_terminal")).toBe("deny")
expect(evalPerm(plan, "interactive_terminal")).toBe("deny") // kilocode_change
// But specific path is allowed
expect(Permission.evaluate("edit", ".opencode/plans/foo.md", plan!.permission).action).toBe("allow")
}),
@@ -98,7 +98,7 @@ it.instance("explore agent denies edit and write", () =>
expect(evalPerm(explore, "edit")).toBe("deny")
expect(evalPerm(explore, "write")).toBe("deny")
expect(evalPerm(explore, "todowrite")).toBe("deny")
expect(evalPerm(explore, "interactive_terminal")).toBe("deny")
expect(evalPerm(explore, "interactive_terminal")).toBe("deny") // kilocode_change
}),
)