Compare commits

..
Author SHA1 Message Date
Julius Marminge 581d533582 rm redundant gen 2026-02-26 20:40:09 -08:00
Julius Marminge 9d46f3ab1d Remove assistant-complete text payload from orchestration flow
- Drop optional `text` from `ThreadMessageAssistantCompleteCommand`
- Stop passing text on assistant-complete ingestion and decider paths
- Ensure completion events no longer overwrite message content
2026-02-26 20:40:09 -08:00
Julius Marminge f8ddb00fcc todo 2026-02-26 20:40:09 -08:00
Julius Marminge aded02febb update todo 2026-02-26 20:40:09 -08:00
Julius Marminge b813af9580 Clarify assistant buffer flush safety-valve comment
- Update wording to say buffered text is flushed as an assistant delta
- Keeps intent clear: memory is capped by emitting the current buffer
2026-02-26 20:40:09 -08:00
Julius Marminge 99143e515e Always flush buffered assistant text as final delta
- Remove spilled-state cache tracking for buffered assistant messages
- Emit any remaining buffered text as a finalize delta on completion
- Keep assistant completion payload text empty in buffered mode
2026-02-26 20:40:09 -08:00
Julius Marminge 899858fc68 Spill full buffered assistant text when buffer exceeds cap
- Change provider runtime ingestion to flush the entire buffered assistant text once it crosses the max size
- Remove partial-retention logic and its keep-chars constant to simplify memory safety behavior
2026-02-26 20:40:09 -08:00
Julius Marminge 3e02cadc40 Spill oversized buffered assistant deltas without losing final text
- cap buffered assistant text memory and spill older chunks as delta events
- finalize buffered messages by emitting retained remainder before completion when spilled
- add regression coverage for oversized buffered deltas and tighten type-safe test assertions
2026-02-26 20:40:09 -08:00
Julius Marminge 2575aa9873 Simplify assistant delivery mode state in runtime ingestion
- Replace per-thread/turn/message delivery-mode caches with a single `Ref`
- Always complete assistant messages with buffered text from message state
- Remove obsolete delivery-mode cleanup and resolution paths
2026-02-26 20:40:09 -08:00
Julius MarmingeandClaude Opus 4.5 999ff66c79 Fix type errors with exactOptionalPropertyTypes
Use conditional spread for turnId to avoid passing undefined
explicitly when the target type expects an optional property.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-02-26 20:40:09 -08:00
Julius Marminge 54e1bf959b Add configurable assistant delivery mode across server and web
- add `AssistantDeliveryMode` contracts and carry mode through turn-start events
- default assistant responses to buffered mode and preserve buffered text until completion
- support streaming mode end-to-end with ingestion/decider updates and test coverage
- add a Settings toggle to enable assistant streaming in the chat UI
2026-02-26 20:40:09 -08:00
+2 -29
View File
@@ -368,7 +368,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
const textareaRef = useRef<HTMLTextAreaElement>(null);
const composerCommandInputRef = useRef<HTMLInputElement>(null);
const composerImagesRef = useRef<ComposerImageAttachment[]>([]);
const sendInFlightRef = useRef(false);
const dragDepthRef = useRef(0);
const terminalOpenByThreadRef = useRef<Record<string, boolean>>({});
@@ -1392,7 +1391,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
const onSend = async (e: React.SubmitEvent | React.KeyboardEvent) => {
e.preventDefault();
const api = readNativeApi();
if (!api || !activeThread || isSendBusy || isConnecting || sendInFlightRef.current) return;
if (!api || !activeThread || isSendBusy || isConnecting) return;
const trimmed = prompt.trim();
if (!trimmed && composerImages.length === 0) return;
if (!activeProject) return;
@@ -1402,23 +1401,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
isFirstMessage && envMode === "worktree" && !activeThread.worktreePath
? activeThread.branch
: null;
// In worktree mode, require an explicit base branch so we don't silently
// fall back to local execution when branch selection is missing.
const shouldCreateWorktree =
isFirstMessage && envMode === "worktree" && !activeThread.worktreePath;
if (shouldCreateWorktree && !activeThread.branch) {
dispatch({
type: "SET_ERROR",
threadId: threadIdForSend,
error: "Select a base branch before sending in New worktree mode.",
});
return;
}
sendInFlightRef.current = true;
setSendPhase(baseBranchForWorktree ? "preparing-worktree" : "sending-turn");
const composerImagesSnapshot = [...composerImages];
const messageIdForSend = newMessageId();
const messageCreatedAt = new Date().toISOString();
@@ -1467,17 +1449,9 @@ export default function ChatView({ threadId }: ChatViewProps) {
branch: result.worktree.branch,
worktreePath: result.worktree.path,
});
// Keep local thread state in sync immediately so terminal drawer opens
// with the worktree cwd/env instead of briefly using the project root.
dispatch({
type: "SET_THREAD_BRANCH",
threadId: threadIdForSend,
branch: result.worktree.branch,
worktreePath: result.worktree.path,
});
const setupScript = setupProjectScript(activeProject.scripts);
if (setupScript) {
await runProjectScript(setupScript, {
void runProjectScript(setupScript, {
cwd: result.worktree.path,
worktreePath: result.worktree.path,
rememberAsLastInvoked: false,
@@ -1556,7 +1530,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
err instanceof Error ? err.message : "Failed to send message.",
);
} finally {
sendInFlightRef.current = false;
setSendPhase("idle");
}
};