Repository navigation
Conversation
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
2 times, most recently
from
November 24, 2026 06:24
f781025 to
5213e9c
Compare
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
from
November 24, 2026 06:56
5213e9c to
c792f33
Compare
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
from
November 24, 2026 08:28
c792f33 to
0162f51
Compare
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
from
November 24, 2026 09:40
0162f51 to
4b11fbc
Compare
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
2 times, most recently
from
November 24, 2026 13:57
4dd26c6 to
b144bbe
Compare
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
from
November 24, 2026 14:10
b144bbe to
5226c91
Compare
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
from
November 24, 2026 14:45
5226c91 to
c49e493
Compare
exec_shell_command takes run_in_background: it returns the first output and a task id. The new shell_task tool lists tasks, reads their output from an offset and stops them. Each task runs in a process group of its own, so stop and server exit reach every process it started. A command that leaves a child in the background no longer holds a foreground call past its timeout. Assisted-by: Claude (Opus 5.5 Medium)
…and a Stop key Assisted-by: Claude (Opus 5.5 Medium)
On wide screens the side cards now sit in a third column of the chat screen, which narrows the messages instead of covering them. Narrower screens keep the folded floating cards. The chat form's one-row layout no longer flips back and forth when an empty row does not fit the narrower column. Assisted-by: Claude (Opus 5.5 Medium)
The side cards show the tasks of the conversation on screen, so the new-chat screen has no column and one chat's tasks never show in another. Clear finished clears only that chat's tasks. Assisted-by: Claude (Opus 5.5 Medium)
allozaur
force-pushed
the
allozaur/feat/background-tasks
branch
from
November 24, 2026 16:43
c49e493 to
4c2e058
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Ask the agent to start a dev server or a watcher and it keeps running in the background: a card on the right of the chat lists such tasks, shows their output and stops them.
Additional information
Layer 5 of the planned stack, on #102 (tools on demand). Unlike the layers below it, this one changes llama-server too. Not tried in a container or over ssh (
--tools-runtime); the tests for those need docker.The model's start call asks for permission like any shell command. Reading or stopping a task asks for nothing.
Cause
exec_shell_commandreads the output pipe until it closes. A command such asnpm run dev &leaves a child that keeps the pipe open, and the timeout kills only the shell, so the call hung until that child exited, which for a server means never. Reproduced on a local build: atimeout: 3call with(sleep 25; echo late) &returned after 25 s.What changed
llama-server (
tools/server/server-tools.cpp):exec_shell_commandtakesrun_in_background. It starts the command, waits for its first output (up to 5 s, or 1 s of quiet), and returns that output plus[background task: N]. The tool description tells the model to use it for dev servers, watchers and log followers, and not to end a command with&.shell_tasktool, enabled withexec_shell_command, withaction:list(tasks with status, exit code, cwd, start/end time),output(output from a byteoffseton, the newest part when there is more; returnsnext_offsetfor polling) andstop.setsidwhere it exists, elseset -m). Stop sends SIGTERM to the group, then SIGKILL after 3 s; server exit kills every task. In a--tools-runtimeisolate the signal is sent inside it.x-tool-cwd,x-tool-runtime,--tools-runtime).--tools-runtime, stop ends only thecmdprocess (no process groups there).Llama Chat:
backgroundTasksStore: each task with its id, command, cwd, conversation, status, exit code, start time and output. Fed by the agentic loop's tool results and by pollingshell_taskwhile a task runs (the list every 2 s, the open task's output every 1 s). The conversation of each task is kept in localStorage.ChatSideCards: from 1024 px a third column of the chat screen, beside the messages, so the cards narrow the chat instead of covering it; below that, folded cards floating in the top right corner. More cards can be added later. The first is Background tasks: the tasks the conversation on screen started, running and finished, with status, elapsed time and Stop; Clear finished. The column only appears while a card has something to show for that conversation, so the new-chat screen has none.ChatForm: the one-row layout no longer flips back and forth (Svelte's update depth error) when an empty row does not fit, which the narrower chat column made happen.TerminalOutput: monospace, ANSI colours mapped to the status tokens, carriage returns applied, follows the tail until you scroll up.exec_shell_commandblock of a background start says it is running in the background (or stopped/exited, live from the store) with a Show task link.BackgroundTasksCard(tasks, open task, stopping, folded) andTerminalOutput(dev server, tail, progress bar, empty).Testing
tools/server/tests/unit/test_tools_builtin.pypasses (22 passed, 5 skipped for docker/podman). New tests: a foreground call with a background child ends near its timeout; start, list, read from an offset, read the tail, stop, and the grandchild is gone after stop; a quick exit reports its exit code; error cases;shell_taskis enabled withexec_shell_command; tasks are killed on server exit. Theshell_tasktests also pass with asetsidon the PATH, and the wrapper was checked with dash.ui/apps/chat:npm run check,npm run lintand the 913 unit tests pass, including new tests for the ANSI parser, the background-task line parser and the store (track, keying by the server list, reading from an offset, stop, dropping tasks the server forgot, Clear finished)./toolsshows in the card, its output follows the tail with colours, and Stop ends it. Asked to "start a dev server for static files in /tmp on port 18500", the model (Inkling 2 Mini) calledexec_shell_commandwithrun_in_background: true, and the permission card asked for it. The rest of that run (the block's background row) was not checked, because the permission card needs a person to answer it.Requirements
Claude (Opus 5.5 Medium)