mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-11-11 04:02:45 -10:00
* feat(mods): run the prompts a Mod submits in the OpenTUI terminal OpenTUI now opts in to the prompts the Mods submit with `$.prompt.submit`. Once the session is idle, the shell asks the live turn to run the next one as a turn of its own, sent as in Ink: the framed text, the Mod's text as the submitted prompt, the hooks' context, the Mod's name and its recall query. It waits for the person's queued prompts and commands, an open dialog, a running `!` command and a submission still being routed. The prompt shows as the info line `Mod <name>: <text>`, live and on resume, is not logged as input, reads no `@` reference and runs no command. Each submission the person sends resets the Mods' turn count; Esc and declining every tool stop the queue, `$.turn.abort` keeps it. OpenTUI resume now draws notification items as info rows, as Ink does. * fix(mods): count the person's prompt when its turn starts in the OpenTUI terminal - Note the person's prompt where their turn starts (and when a command or `!` command runs), not at the composer, so a queued prompt that runs after a decline-all stop lets the Mods submit again, and refused input no longer resets the stop or the turn limit. - Put back a Mod's prompt whose turn ended before admission, as ink does; it waits for the next turn rather than retry in a loop, and its line shows only once admitted. - A retried Mod prompt reaches the sidecar as the Mod's text, not the frame. - Re-run the drain after a submission only when a Mod's prompt waits. - Fix the TS4111 index-signature access in live-session.test.ts that broke the build, and name the scratch dir after the renderer. * fix(mods): put back only a Mod prompt that never reached the model client - A Mod's prompt that a UserPromptSubmit hook blocked or failed is spent, as in ink, rather than coming back after every turn and repeating its sidecar messages; only a turn that failed before its request (the Mods failed, the prompt failed to prepare, the transcript was reset) puts it back. - The held put-back also clears when a Mod queues a prompt and when the transcript resets, so commands and a new session don't stall it. - The person's steering counts as their prompt for the Mods' limit and stop. * docs(mods): say a prompt queued during an OpenTUI turn counts when it runs * docs(mods): say only OpenTUI counts steering text toward the Mod turn limit * fix(mods): hold a Mod's prompt in OpenTUI while a Goal owns the turns * docs(mods): say an active Goal holds a Mod's prompt in OpenTUI until the person acts * test(mods): pin the OpenTUI Mod prompt holds and the person-prompt count * fix(mods): start an OpenTUI Mod prompt outside a subagent's frame The shell's drain of the Mods' prompts now runs the turn through runOutsideAgentContext, as ink's drain does (#7156). A commit that batched a subagent's progress update made inside its agent frame would otherwise start the Mod's turn on the subagent's runtime view, so it would resolve the subagent's model. A Mod prompt's turn that the transcript reset left behind still puts the prompt back, but only the current turn holds it. Before, the stale turn's finally set the hold again after resetTranscript had released it, and it could also hold a turn started after the reset. --------- Co-authored-by: Shaojin Wen <[email protected]>