fix(electrobun): hasSession checks running status (dead sessions no longer block startAgent)
This commit is contained in:
parent
f1472848f8
commit
8031cf91cf
2 changed files with 10 additions and 2 deletions
|
|
@ -132,11 +132,14 @@
|
|||
}
|
||||
|
||||
function handleSend(text: string) {
|
||||
console.log('[ProjectCard] handleSend called:', { id, provider, cwd, model, hasSession: appState.agent.hasSession(id), text: text.slice(0, 50) });
|
||||
if (appState.agent.hasSession(id)) {
|
||||
console.log('[ProjectCard] calling sendPrompt');
|
||||
appState.agent.sendPrompt(id, text).catch((err) => {
|
||||
console.error('[agent.prompt] error:', err);
|
||||
});
|
||||
} else {
|
||||
console.log('[ProjectCard] calling startAgent');
|
||||
appState.agent.startAgent(id, provider, text, { cwd, model }).catch((err) => {
|
||||
console.error('[agent.start] error:', err);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue