Merge branch 'cw/agent-details' into cw-merge-1772802959182

This commit is contained in:
Lukas May
2026-03-06 14:15:59 +01:00
19 changed files with 1934 additions and 16 deletions

View File

@@ -18,6 +18,7 @@ export interface AgentInfo {
status: string;
initiativeId?: string | null;
worktreeId: string;
exitCode?: number | null;
}
export interface CleanupStrategy {

View File

@@ -374,6 +374,7 @@ export class AgentLifecycleController {
status: agent.status,
initiativeId: agent.initiativeId,
worktreeId: agent.worktreeId,
exitCode: agent.exitCode ?? null,
};
}
}

View File

@@ -347,7 +347,7 @@ export class MultiProviderAgentManager implements AgentManager {
this.createLogChunkCallback(agentId, alias, 1),
);
await this.repository.update(agentId, { pid, outputFilePath });
await this.repository.update(agentId, { pid, outputFilePath, prompt });
// Register agent and start polling BEFORE non-critical I/O so that a
// diagnostic-write failure can never orphan a running process.
@@ -1182,6 +1182,8 @@ export class MultiProviderAgentManager implements AgentManager {
createdAt: Date;
updatedAt: Date;
userDismissedAt?: Date | null;
exitCode?: number | null;
prompt?: string | null;
}): AgentInfo {
return {
id: agent.id,
@@ -1197,6 +1199,8 @@ export class MultiProviderAgentManager implements AgentManager {
createdAt: agent.createdAt,
updatedAt: agent.updatedAt,
userDismissedAt: agent.userDismissedAt,
exitCode: agent.exitCode ?? null,
prompt: agent.prompt ?? null,
};
}
}

View File

@@ -142,6 +142,8 @@ export class MockAgentManager implements AgentManager {
accountId: null,
createdAt: now,
updatedAt: now,
exitCode: null,
prompt: null,
};
const record: MockAgentRecord = {

View File

@@ -95,6 +95,10 @@ export interface AgentInfo {
updatedAt: Date;
/** When the user dismissed this agent (null if not dismissed) */
userDismissedAt?: Date | null;
/** Process exit code — null while running or if not yet exited */
exitCode: number | null;
/** Full assembled prompt passed to the agent process — null for agents spawned before DB persistence */
prompt: string | null;
}
/**