fix(electrobun): session resume uses pending mode — user types prompt first, no empty string to SDK

This commit is contained in:
Hibryda 2026-03-27 03:35:02 +01:00
parent 31a3335651
commit 18b9c7c3b5
3 changed files with 49 additions and 6 deletions

View file

@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import type { ClaudeSessionInfo } from './agent-store.svelte.ts';
import { listProjectSessions, resumeSession, continueLastSession, startAgent } from './agent-store.svelte.ts';
import { listProjectSessions, setPendingResume, getPendingResume, clearPendingResume } from './agent-store.svelte.ts';
import { t } from './i18n.svelte.ts';
interface Props {
@ -72,18 +72,21 @@
return s.length > max ? s.slice(0, max - 3) + '...' : s;
}
async function handleContinue() {
function handleContinue() {
open = false;
await continueLastSession(projectId, provider, '', cwd);
setPendingResume(projectId, 'continue');
// User types their next prompt and hits Send — startAgent reads the pending resume
}
async function handleResume(sdkSessionId: string) {
function handleResume(sdkSessionId: string) {
open = false;
await resumeSession(projectId, provider, sdkSessionId, '', cwd);
setPendingResume(projectId, 'resume', sdkSessionId);
// User types their next prompt and hits Send — startAgent reads the pending resume
}
function handleNew() {
open = false;
clearPendingResume(projectId);
onNewSession?.('');
}
</script>