refactor: remove terminal agent concept entirely
Remove the "agent can be a terminal" branching from the entire codebase. An agent is now always a session-backed chat agent. Standalone terminal infrastructure (terminal component, ANSI handling, terminal-stream-protocol) is preserved. Server: delete ManagedTerminalAgent, AgentKind, TerminalExitDetails, launchTerminalAgent, registerTerminalAgent, handleTerminalAgentExited, supportsTerminalMode capability, buildTerminalCreate/ResumeCommand from all providers, terminal agent persistence/projections. App: delete terminal-agent-panel.tsx, terminal-agent-reopen-store.ts, terminal/terminalExit fields on agent state, "Terminal Agents" launcher section, terminal-agent workspace setup flow, terminal badge in agent list. CLI: remove terminal column from ls, terminal-agent error from send. 60 files changed, -3592 lines
This commit is contained in:
@@ -25,7 +25,6 @@ export interface AgentListItem {
|
||||
shortId: string;
|
||||
name: string;
|
||||
provider: string;
|
||||
terminal: boolean;
|
||||
thinking: string;
|
||||
status: string;
|
||||
cwd: string;
|
||||
@@ -67,7 +66,6 @@ export const agentLsSchema: OutputSchema<AgentListItem> = {
|
||||
{ header: "AGENT ID", field: "shortId", width: 12 },
|
||||
{ header: "NAME", field: "name", width: 20 },
|
||||
{ header: "PROVIDER", field: "provider", width: 15 },
|
||||
{ header: "TERM", field: "terminal", width: 6 },
|
||||
{ header: "THINKING", field: "thinking", width: 12 },
|
||||
{
|
||||
header: "STATUS",
|
||||
@@ -93,7 +91,6 @@ function toListItem(agent: AgentSnapshotPayload): AgentListItem {
|
||||
shortId: agent.id.slice(0, 7),
|
||||
name: agent.title ?? "-",
|
||||
provider: model ? `${agent.provider}/${model}` : agent.provider,
|
||||
terminal: agent.terminal === true,
|
||||
thinking: agent.effectiveThinkingOptionId ?? "auto",
|
||||
status: agent.status,
|
||||
cwd: shortenPath(agent.cwd),
|
||||
|
||||
@@ -17,11 +17,6 @@ export interface AgentSendResult {
|
||||
message: string;
|
||||
}
|
||||
|
||||
function isTerminalAgentSendError(error: unknown): boolean {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
return /terminal agents do not support structured send operations/i.test(message);
|
||||
}
|
||||
|
||||
/** Schema for agent send output */
|
||||
export const agentSendSchema: OutputSchema<AgentSendResult> = {
|
||||
idField: "agentId",
|
||||
@@ -265,15 +260,6 @@ export async function runSendCommand(
|
||||
} catch (err) {
|
||||
await client.close().catch(() => {});
|
||||
|
||||
if (isTerminalAgentSendError(err)) {
|
||||
const error: CommandError = {
|
||||
code: "TERMINAL_AGENT_UNSUPPORTED",
|
||||
message: "Cannot send messages to terminal agents",
|
||||
details: "Open the terminal agent from the Sessions UI and interact through its terminal.",
|
||||
};
|
||||
throw error;
|
||||
}
|
||||
|
||||
// Re-throw CommandError as-is
|
||||
if (err && typeof err === "object" && "code" in err) {
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user