fix(chat): settle authoritative turns and make capabilities explicit

This commit is contained in:
2026-10-20 15:45:09 +01:00
parent 016fcb552a
commit e504780976
16 changed files with 615 additions and 56 deletions
+3 -2
View File
@@ -1612,6 +1612,7 @@ export function applyChatEvent(thread, frame, now = Date.now()) {
case PART_TOOL:
return applyTool(current, frame, now);
case EVENT_STEP:
if (frame?.step?.intermediate) return current;
return setThreadRunning(current, str(frame?.step?.status) !== STEP_ENDED, now);
// A shell frame only folds its shell into the retained set: it NEVER marks
// the thread running, because a background process is not the turn — a shell
@@ -1948,7 +1949,7 @@ export function queuedAfterFrame(queued, frame) {
* running bit, which the composer's Stop control reads.
*/
export function runningAfterFrame(running, frame) {
if (frame?.kind === "step" && frame?.step?.status === "ended") return false;
if (frame?.kind === "step" && frame?.step?.status === "ended" && !frame?.step?.intermediate) return false;
return running === true;
}
@@ -1961,7 +1962,7 @@ export function runningAfterFrame(running, frame) {
* A browser-side guard, so a runaway pick is refused with a reason instead of
* being handed to the server; the server applies its own limits on top.
*/
export const MAX_ATTACHMENT_BYTES = 25 * 1024 * 1024;
export const MAX_ATTACHMENT_BYTES = 1024 * 1024;
/** The fallback display name when neither the name nor the uri gives one. */
export const ATTACHMENT_FALLBACK_NAME = "file";