fix(quick-pane): preserve lifecycle and answer history
This commit is contained in:
@@ -67,7 +67,8 @@ function normalizePiEvent(event) {
|
||||
case "extension_ui_request":
|
||||
return { type: "extension_ui_request", data: { event } };
|
||||
case "extension_error":
|
||||
// Extension errors are diagnostics; the Pi process can still be healthy.
|
||||
case "thinking_level_changed":
|
||||
// Informational Pi notifications do not change runtime health.
|
||||
return { type: "transcript", data: { event } };
|
||||
default:
|
||||
return undefined;
|
||||
@@ -209,6 +210,7 @@ export function startPiRpcAdapter({
|
||||
"unsupported_event",
|
||||
`Pi RPC emitted unsupported event: ${event.type}`,
|
||||
),
|
||||
{ terminal: false },
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -229,7 +231,6 @@ export function startPiRpcAdapter({
|
||||
"frame_too_large",
|
||||
`Pi RPC frame exceeds ${maxFrameBytes} bytes`,
|
||||
),
|
||||
{ terminal: false },
|
||||
);
|
||||
const consumeStdout = (text) => {
|
||||
let remaining = text;
|
||||
@@ -303,10 +304,7 @@ export function startPiRpcAdapter({
|
||||
send(commandInput, { timeoutMs: requestedTimeoutMs } = {}) {
|
||||
if (!isRecord(commandInput) || typeof commandInput.type !== "string") {
|
||||
return Promise.reject(
|
||||
new PiRpcError(
|
||||
"invalid_command",
|
||||
"Pi RPC command must include a type",
|
||||
),
|
||||
new PiRpcError("invalid_command", "Pi RPC command must include a type"),
|
||||
);
|
||||
}
|
||||
if (Object.hasOwn(commandInput, "id")) {
|
||||
@@ -382,10 +380,7 @@ export function startPiRpcAdapter({
|
||||
if (closed) return exited;
|
||||
intentionalStop = true;
|
||||
rejectPending(
|
||||
new PiRpcError(
|
||||
"child_stopped",
|
||||
"Pi RPC child was stopped by the bridge",
|
||||
),
|
||||
new PiRpcError("child_stopped", "Pi RPC child was stopped by the bridge"),
|
||||
);
|
||||
child.kill("SIGTERM");
|
||||
return exited;
|
||||
|
||||
Reference in New Issue
Block a user