A command that talks to the network (/connect, /model probe, a plugin
command, a commands/ program) ran on the UI thread: the prompt froze until
it returned. ui_command_run() now runs be->input on its own thread while
the screen keeps reading keys. One next line can be queued and is processed
when the command ends; Ctrl-C clears the edit, Ctrl-D quits. The worker
never touches curses, and the backend is not polled while it runs.
Widget text may now have continuation lines without "name:": they are
rendered under the widget above. sysinfo uses that for one metric per row
instead of wrapping "RAM ... CPU ..." into the same paragraph. A blank row
stays between widgets, not between their rows.
The Ctrl-C UI test looks for the active steer prompt; "working" is replaced
by it on the first 100 ms tick.
make check: all tests passed.
The goal lived only in the focus plugin's memory: a resume lost it and
there was no way to start the next turn from it. It is now stored in the
session's .meta (one line, 1000 bytes) and read back when the plugin sees a
new session id, so /open and a resumed process find their own goal again.
/continue reads the same sidecar and starts a turn with "Continue working
toward this goal: ...". /goal still sets it and starts the recap turn.
The sidebar was a patchwork of pairs and widgets could inherit the wrong
background. It now uses one PAIR_SIDE (white on a darkened theme
background) for every heading, label, usage row and widget; the window
gets that pair as its background, so no line paints its own surface.
New plugins/sysinfo: a widget thread samples /proc/meminfo, /proc/stat and
statvfs("/"), and publishes RAM, CPU, swap and disk with five-cell
[|||| ] gauges every two seconds. It is added to the shipped plugin list
and to the user's config.
agent.c keeps the last prompt/cache counters when a tool-call step reports
no usage. A zero there used to reset the ctx gauge in the status bar after
every tool call.
Tests: session goal survives reopen, /continue returns the prompt,
make check: all tests passed.
Three things the screen and the goal were getting wrong.
Colours. The theme had one accent for the user and grey for everything
else. theme.h now carries agent, think, tool and notice colours. A CDE
palette maps them to sets 7 (answer), 3 (reasoning), 6 (tool) and 8
(status); Xresources uses colour10/11/14/13 on dark and 2/3/6/5 on
light. Role colours keep their hue and are pushed from the surface only
when they would disappear; each role has a slightly different minimum,
so even a monochrome palette yields distinguishable steps. The 256-colour
mapping now takes the nearest cube/ramp entry instead of rounding each
channel down, which turned a dark orange into grey 240.
Usage. sp_usage_get() only counted requests inside a declared window. A
provider without limit= therefore always read "0 calls" in the sidebar,
although every call was in its log. Calls are now counted when no window
is declared; test_usage covers it.
Goal. /goal <text> set a variable and answered "goal set" without starting
a turn. The engine now starts the recap prompt: the model writes a short
recap, the focus plugin remembers that answer and injects it every seventh
turn (SPLINTER_FOCUS_EVERY still overrides). /recap is gone as a command;
its old behaviour is what /goal does now. A palette and a wiki page are
not enough to make that visible: the prompt, the confirmation entry and
the sidebar goal all show up in the chat.
Tests: palette role separation and indexed roles in test_theme, four
unlimited calls in test_usage, recap capture/injection and the missing
/recap in test_focus, and a settle delay so the UI tests type after
ui_read_line() owns the keyboard. make check: all tests passed.
- sp_engine_switch(): close the old engine and open the chosen session from
the same options; if the new one fails, reopen the session the engine was
on. The protocol's open and the in-process /open both use it. The curses
screen clears the pane and replays the new history, so /open no longer says
it needs --attach.
- gateway: temperature, top_p and max_tokens (max_completion_tokens) are
forwarded to the provider instead of dropped; request bodies may be
Transfer-Encoding: chunked; a mixed reply runs the gw_ calls, returns the
caller's calls in tool_calls and puts the local observations in content
(also in the SSE delta), so the caller can echo them back.
- reconnect: when the remembered session is gone, the screen says which one
and stays on the session the server has instead of silently swapping the
transcript.
- ring: the exits' transports are disposed on plugin shutdown.
- /status goes through the catalogues like the rest of the UI (the English
labels and their alignment are unchanged, so existing parsers still work).
- the man page passes mandoc -Tlint and covers the gateway and /open.
Tests: test_ui.sh covers local /sessions and /open (new, back, history),
test_protocol.sh the shared switch, test_reconnect.sh a vanished session,
test_gateway_openai.sh forwarded parameters, a chunked body and the mixed
reply in JSON and SSE. make check green.
Removing it went too far: the conversation area should be plain appended
text, but the sidebar carries what no line of the transcript should repeat -
agent, provider and model, what is left of the allowance, the plugin widget
lines, the session and now the directory the tools act in ("~" for $HOME,
wrapped at the slashes). A narrow terminal drops it and gives the width to
the conversation.
No status bar: the running time and the tool lead the prompt, and /usage,
/status and /widgets print the same numbers on demand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chat is now the whole screen and the input line the row below it: no
sidebar, no status bar. Entries are append only -- a growing answer stays in
its entry while it is the last one and continues in a new entry once a tool
line follows, so nothing that was on screen ever moves. The prompt carries
the agent name ("build> "), /widgets shows what plugins published, and
/status still prints the status segments.
The default theme is Xresources: *foreground, *background and *color0..15
from xrdb -query (or ~/.Xresources), falling back to the terminal's own
colour indices. Every CDE palette is a theme by its own name, painted the
way the desktop paints it (set 5 windows, set 4 text areas, set 6 dialogs,
set 1 active frame, set 2 inactive frame) with CDE's black-or-white rule.
"Default" is therefore the CDE Default palette again, which is what the
config asked for.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- anthropic: two messages of the same role in a row (a failed turn asked
again) put the second one's blocks after the closed message object; the
API answered 400 "messages.1.role: Field required". The message now stays
open until the role changes.
- exit took 20+ s: the mcp plugin's HTTP round trip to a server that is down
had curl -m 60 and nothing killed it; shutdown now kills the curl in
flight, and connects time out after 5 s. Widget threads slept a whole
interval before seeing the stop flag; they sleep in 100 ms steps.
- /quit (/exit, /q) leaves the chat.
- the prompt mark has its space again: the catalogue trims trailing blanks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A kind = cli provider now has a default model and a prefix
(provider = opencode), so -m occli/deepseek-v4.1-flash-free runs
"opencode run --model opencode/deepseek-v4.1-flash-free". {model} in cmd
marks where the model goes, otherwise --model is appended; a model that
already has a '/' is used as it is. sp_cli_command() builds the command for
-m, delegates and the cli plugin's pool fallback. Model names are limited to
letters, digits and ._:/@+- since the command goes through /bin/sh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kind = anthropic: the Messages API over curl, OAuth tokens (sk-ant-oat)
as Bearer with the oauth beta, tool_use/tool_result blocks.
- --doctor spends no tokens: it asks /models and the provider's own usage
route (ollama /api/balance, opencode go /v1/usage) instead of a tiny turn;
cli providers are only checked for the program. /usage shows the same
provider figures, cached for a minute.
- endpoint names the API base (https://host/v1); sp_endpoint_url() builds
chat/completions (default), messages, models and usage from it. A full
route is still accepted and cut back to the base.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MCP client could only start one program and talk to it on a pipe; a server
behind an endpoint (junction at http://host:8090/mcp) had no way in. Now the
config names the servers and the plugin speaks whichever transport each one
offers:
- new `mcp NAME { url | cmd | header | enabled }` block (and the flat
`mcp = NAME | url=...` form), parsed into struct sp_mcpserver; an entry
without a url and without a cmd is refused with its line number
- streamable HTTP in plugins/mcp/mcp.c: one POST per JSON-RPC message, answered
with one JSON object or an SSE stream of `data:` lines - both are read,
Mcp-Session-Id is kept and echoed back, and the Authorization header travels
through curl's stdin config so the token never appears in ps
- several servers register side by side; tools are mcp_<tool> for one server
and mcp_<server>_<tool> for more, so two servers that both offer `search` do
not overwrite each other. A server that fails its handshake is reported and
skipped, the rest still load. SPLINTER_MCP_CMD stays as the one stdio server
- tests: the config and block parsers, and a socket server in test_mcpclient
that refuses the tool list without the configured header and answers the call
as an event stream
- README and docs/CONFIG.md describe both transports and where the token lives
- openai transport sends x-opencode-session (opencode-go refused every request
without it) and a splinter user agent
- the message catalogues are compiled in: an installed binary no longer shows
raw keys (ui.ready ...); LANG=de_DE now selects German (lang was emptied by an
overlapping snprintf), pt_BR is matched
- sidebar rewritten (agent, provider/model, usage, goal/plan, last turn);
idle widgets say nothing; status line shows only what matters
- tool calls shown readable instead of JSON with \u escapes
- providers without their key variable are skipped by pools and refused by -m
with a clear message; --doctor checks every provider
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
planner: v0.2, state in plan_task_*.json via libmcp, atomic replace, refused states.
tmux: v0.3, in-process capture-pane diff, no watcher helper, tmux_ask/read/capture.
tests: test_tmux added, test_delegate_cli no longer hangs without a tty.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
a2a_send posts SendMessage with a text part and, when a path is given, a file
part: base64 bytes, a name (the path's last component) and a media type
guessed from the name, at most 8 MiB -- the same cap the server enforces on
the way in. The answer is text; a file the other side sends back is saved by
collect_parts and named by path, which the tool returns.
sp_b64_encode is the missing direction of the base64 helper, with vectors of
its own in test_b64: empty input, one and two trailing bytes, a NUL.
test_a2a: a real PNG is attached, the request carries name, mimeType and the
base64 bytes, and the other side names it in the answer; a missing path is an
error, not a silent empty message.
The client half had GetTask and CancelTask; a subscription is the one that
shows what a task is doing. The tool posts SubscribeToTask and reads the SSE
stream into one observation: each statusUpdate's state and message, each
artifactUpdate's text, and a whole task if the server sends it that way, in
the order the events arrived. A plain JSON-RPC answer -- usually the
TaskNotFound error -- is read too, so a refused subscription says -32001
instead of 'no events'.
The fake agent answers SubscribeToTask with a status update plus an artifact;
test_a2a drives the tool through the script transport and checks the happy
path and the unknown id.
/model writes its choice to <config>.d/90-model.conf, so the next start uses
it; picking main deletes the file and the configuration speaks again. With a
plugin transport nothing is written, because that program picks the model.
/model probe asks every endpoint /v1/models and offers what it really serves
as buttons; the callback carries an index, because a GGUF path does not fit
in Telegram's 64 bytes. The TUI gets the same command: the list, or
/model <id|name>, with the same persistence.
/connect runs one tiny turn against the provider it just saved (30 s) and
says whether endpoint, model and key answer. The message with the buttons
goes out before the wait starts, so the save is visible immediately.
A2A no longer refuses binary parts: file{bytes} and raw with a non-text media
type are written to the session's inbox (0600, 8 MiB cap) and the prompt says
[file <name> at <path> (mime, n bytes)], so a text model can hand the file to
a tool. The client saves what a remote agent sends the same way
(SPLINTER_A2A_INBOX). SubscribeToTask stays refused: the task store has no
live events, and a one-shot replay would pretend to be a subscription.
Markdown gains <https://...> autolinks and images (as links, since Telegram
has no inline image without sendPhoto).
The plugin registers a2a_get_task (read) and a2a_cancel_task
(destructive) for a local model that uses A2A as a tool source; both
share the endpoint or card and return the raw task/error JSON.
The server's GetTask result was wrapped as {"task": ...}; the spec's
result is the Task itself. Fixed, and the test checks the shape.
The website's tool-count regex missed digits, so a2a_get_task and
a2a_cancel_task were not counted; [a-z0-9_]+ now reports 25.
test_a2a drives both tools through the mock transport and checks the
session observations. Full make check green.
The server accepts text, a string in data, and a text/plain raw part
(base64) via the new sp_b64_decode; a url part (not fetched) or a binary
part is refused with ContentTypeNotSupported (-32005). The client reads
text, string data and text/plain raw, ignoring parts it cannot render.
The agent card now says streaming:true and pushNotifications:false.
test_b64 covers the decoder; test_a2a reads raw/data from the fake
agent; test_a2a_server accepts a raw part and refuses a url. test_ui
waits for the turn label to disappear after Ctrl-C before typing again.
Full make check green.
The widget tick calls load_tasks() every five seconds; a tool updating a
task at the same moment had its array reset under it, which made
test_planner fail intermittently (about one run in six). A recursive
mutex now covers the three tools, the /tasks command and the tick; the
reload and the save happen under the same lock.
Found by running test_planner repeatedly after a full check failed once;
20 consecutive runs pass now.
SPLINTER_A2A_CARD names the card; the first send picks the JSONRPC entry
from supportedInterfaces, falls back to the older single url field, and
keeps the discovered URL for the session. SPLINTER_A2A_URL still wins
when both are set. The card fetch uses the same secret handling as a
send: the bearer token goes through curl's stdin.
The fake agent serves both card shapes, and test_a2a.sh covers discovery
with and without supportedInterfaces.
The A2A transport implements send_stream now: SSE events are read as
StreamResponse (task, message, statusUpdate, artifactUpdate), artifact and
message text goes to the screen as it arrives, intermediate status notes
are ignored, and a completed status message is the answer only when no
artifact or direct message text came. Failed/canceled/rejected and
input/auth-required states fail the turn instead of becoming an answer.
One-shot mode already streamed whenever a transport offered it, so the
plain send path was unreachable from the CLI. --no-stream asks for it.
test_a2a.sh covers both SendMessage and SendStreamingMessage; the new
test_a2a_ui.sh drives the UI streaming path through tmux.
README, PLUGINS.md, the man page and the site follow.
plugins/a2a sends one SendMessage over JSON-RPC 2.0 with a text part and
reads either a direct Message or a Task in TASK_STATE_COMPLETED (status
message plus artifact text). Task and context ids are kept for the session;
a terminal task loses its id but keeps the context. Bearer token, timeout
and SPLINTER_A2A_FULL are supported.
Text only. Streaming, file/structured parts, push notifications,
GetTask/CancelTask and agent-card discovery are named as not built, so
nobody assumes otherwise.
tests/fake_a2a.py and tests/test_a2a.sh pin the wire shape, both result
forms, the bearer token and a JSON-RPC error. The site now counts the new
plugin (16) and names the transport; README, PLUGINS.md and ROADMAP follow.
TODO also records the live claude check: both configured accounts are at
their limit, exit 1 with the child's text, claude0 benched and claude1
queued; exit 2 remains unreproduced.
cli_fallback = claude1, claude0 names cli delegates whose cmd and env=
take over when cli_cmd answers with its limit. The main command is
benched as "cli", a fallback under its own id, on the same bench the
delegation uses (sp_limit_parse, sp_cooldown_until, sp_cooldown_set are
now exported from libsplinter). The session key stays, so claude
resumes the same conversation under the next account. With everyone
benched the turn fails with the first reset, as WAIT_QUOTA ready_at=.
A fallback's env= goes through a 0600 file the shell sources, not a
command line. A delegate's child is benched under the delegate's id
(SPLINTER_CLI_ID), never as "cli".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cli transport keys the program's own session on SPLINTER_CLI_SESSION
(the splinter session id, plus ':<delegate>' for a delegate child):
claude gets a derived UUID, --session-id first and --resume after, with
one retry when claude disagrees; opencode gets --session ses_<derived>;
other programs can use {session} and {uuid}. Consecutive calls continue
one conversation and hit the provider cache (measured: 17.6k read, 80
written on the second call).
A delegate whose answer is a limit (429, rate/usage/weekly limit, quota)
is benched until the reset it names - claude's "resets 3am
(Europe/Lisbon)" is read through date(1) - in ~/.splinter/cooldown/<id>,
and the task goes to the next delegate that fits. choose() skips benched
delegates, also when one is asked for by name.
run_child now carries the tail of the child's output in its error and
treats a signal as failure; "exited 1" alone hid every limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
env=NAME=VALUE on a delegate line (repeatable) is set in the child right
before exec and beats what the parent exported, so two delegates can run
the same cli with two accounts. Remotely it goes in front as
`env 'NAME=VALUE'`, quoted like the rest. cli_env = NAME=VALUE does the
same for the main cli transport. A bad name is an error with the line.
Also in this commit, the work in progress from the tree: swarm and
provider state, the provider/scheduler/planner/tmux plugins, the ui test,
whose tmux session name is now per run so parallel runs do not collide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Telegram gateway
- A tool call of the gateway's own turn that needed consent was either denied
(a daemon has no approval stream) or, with ack channels set, waited for an
"ok <id>" that only the blocked gateway could have read. It now asks in the
chat the turn came from, keeps reading while it waits, resolves answers
(also other processes' and 'splinter --ack'), ignores strangers and tells
everything else to wait. The update offset is shared, so nothing is handled
twice. New cfg flag approve_is_channel: such an approve is asked directly.
- send_message wrote its error through err, and half the callers pass NULL: the
first refused message (too long, bad UTF-8) crashed the gateway. It also
missed '"ok": true' by substring; the reply is parsed now.
- tests/test_gateway.sh drives the real daemon against a fake Bot API and a
fake model (tests/fake_telegram.py), with "ok" and with "no". In make check;
.gitignore no longer hides tests/test_*.sh.
Approvals
- A channel was told "Zustimmung <id>" and nothing else: a phone said yes to a
number. The message now names the tool and its arguments (cut at 300 bytes)
and how to answer, and goes to the channel as "$1", never parsed by sh.
Smaller
- ring: an exit that already streamed text is not retried on the next one
(the operator saw a second answer after half of the first); the header now
says what moves the ring - limits and providers that are down.
- cli: the program's stderr went over the curses screen and the error quoted
stdout. stderr goes to a file and into the error; temp paths are quoted;
the BODY_CAP no-op is gone. (That is the "kaputt" make check used to print.)
- memory: memory_key_env became an env var curl never reads, so no request had
a key. It is "Authorization: Token <key>" now, on curl's stdin. Tested.
- docs/CONFIG.md: the real default path, and the seven keys it did not know
(telegram_allow, memory_url, memory_key_env, skills_dir, env_delegates,
exit, delegate) with the line formats, checked against the parser.
- The no-token message named a config key that does not exist.
Left as it is, on purpose: 'read' stays unrestricted (decision); the fsync per
session line stays (durability over latency).
make check: 26 test binaries and the gateway script, green, also under
ASan/UBSan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each change has a test that fails against the code before it.
Also note: 8900d7f ("telegram: refuse to start without a token") swept in
work of this round that its message does not describe - an OLLAMA_KEY no longer
overwrites the key of the operator's last exit (config.c), parallel delegates
are killed and reaped after a timeout (delegate.c), lcm/cps never leave a tool
result without its call, cps keeps working past 256 messages, Telegram ids are
parsed as 64 bit, and 'run' also hides SPLINTER_OLLAMA_KEY_* and
SPLINTER_MCP_TOKEN.
MCP client (plugins/mcp)
- fgets into char[16384] split every longer reply into unparseable pieces; a
big tools/list or file read never arrived. A reply sharing one write with a
notification sat in stdio's buffer, invisible to poll(). Lines are now
buffered on the fd (up to 16 MiB). An error is the top-level "error" member,
not the text "error" anywhere in the line. test_mcpclient.
kids
- Rules were matched against the raw JSON, so "run ls*" never matched. They
now see the command, path or url. A 'run' command that can chain, substitute
or redirect is never whitelisted. The glob is linear instead of exponential.
test_kids, which also covers the approval-command quoting and the domain
checks from the first round.
Plugin life (src/plugin.c, ABI 2)
- An init() that failed kept what it had registered (tools, gate, widget
threads); it is now rolled back. shutdown() was never called; the host calls
it, newest plugin first, after the widget threads have stopped.
- A widget slot is filled before it is counted, and the count is read under the
lock, so tick threads never see a half-made slot.
- SP_PLUGIN_ABI is 2: struct sp_gate grew block_turn while the ABI stayed 1.
test_lifecycle, with tests/plugin_lifecycle.so.
UI
- Ctrl-C and Ctrl-D cancel under the lock and wake a turn waiting for approval
(it waited forever); Ctrl-D cancelled nothing before the join.
- A steer the turn already took is not sent again as the next message.
- KEY_RESIZE re-cuts the windows; Ctrl-L repaints instead of sending the
half-typed line; key codes above 255 are not typed into the input.
- Markdown attributes went to stdscr while the text went to ui_hist: bold and
code never showed. They now build on the line's role colour.
Checked in tmux: UTF-8 input, resize to 70x20, Ctrl-L, Ctrl-D, bold.
Telegram
- Replies are split on UTF-8 boundaries; a cut umlaut made Telegram refuse the
chunk and the rest of the answer was lost.
Build
- Seven plugins linked with an undefined $(PLUGIN_LDFLAGS): no rpath, no LIBS.
All eleven now carry $ORIGIN/../..; objects depend on the interface headers.
Seen, not changed: sp_session_append fsyncs every line; under disk load an
answer appears up to 15 s late. Not a deadlock, and the same before this round.
make check: 26 test binaries, green, also under ASan/UBSan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gateway entry point accepted an empty token and then polled with it; the
guard belongs there so a daemon that cannot listen says so instead of looking
alive.
Honest limit of this change: it is NOT the explanation for the running daemon.
That one had a token (resolved from the token file) and failed with 'curl: (35)
Recv failure: Connection reset by peer' thousands of times, and with the env
variable removed it now fails with 'curl failed (-1)' and stops - a different
error, not the missing token. The guard only catches the case where neither the
environment nor the file provide one.
What this commit does prove: with a config that has endpoint, model and
telegram_allow, the daemon starts, reports 'gateway listening (allow: 8300935)',
and stops on the failing poll instead of looping. What it does not prove: that a
valid token makes it work - that needs a real message.
A review found the tool classes - the core of the harness - bypassable in
several places where model output was pasted into a shell or trusted as an id.
Each fix below has a test that reproduces the original failure.
No shell for model data
- webfetch put the URL between '...' and ran it through popen: a quote in the
URL ran any command, from a tool that needed no consent. curl is now exec'd
with an argv, http(s) only, HTML stripped in C, stderr off the curses screen.
- webfetch is mutate: with read free, "read a key, fetch evil/?k=..." left the
machine without anybody being asked. websearch stays read (fixed host).
- kids: the parent-approval command got the model's arguments inside '...'
via system(); they are now "$1". The domain check reads the URL with the
same parser as the tool (duplicate keys) and refuses user@host URLs.
- delegate: the two copies of the child argv are one (exec_delegate). The ssh
path exec'd splinter with "ssh" as argv[0]; it now runs ssh and quotes every
word for the remote shell. A single delegate to a host now really runs there.
Approvals (ack)
- The id was the pid: a late yes stayed on disk and approved the next request
unseen. Ids are random, requests 0600 with O_EXCL, deleted when answered or
expired; an answer is refused after expiry; the first answer wins (link(2)).
- An ack dir owned by someone else or writable by others is refused.
- --ack accepted every word but "no" as yes ("nein" approved). Now strict.
- The terminal thread blocked in fgets after a phone answer; it is stoppable.
Secrets
- API key and Telegram token were in curl's argv, readable via ps. src/curl.c
passes URL and auth headers as a -K config on stdin (transport, telegram,
tg-ask.sh; its dead eval fallback is gone).
- 'run' and task_start no longer inherit splinter's keys ("run env"). 'run' got
its own process group, stdin /dev/null and SPLINTER_RUN_TIMEOUT (300 s).
MCP server
- Beyond 127.x it refuses to start without SPLINTER_MCP_TOKEN; connections
must begin with "AUTH <token>". SIGPIPE ignored, idle connections closed.
Crashes
- task_kill sent kill(-0) - SIGTERM to splinter's own process group - because
popen gave no pid. Tasks now have a pid and a process group; integer ids work.
- ui: a 3- or 4-byte UTF-8 character overflowed char[2] on every redraw
(now sp_ui_ascii_char, tested); the scroll offset was taken from one buffer
and applied to another, reading past its end.
Repo
- The test binaries are no longer tracked (.gitignore already said so).
make check: 23 test binaries, green, also under ASan/UBSan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A delegate is work someone else does while we wait, so it belongs in the task
panel with its own clock. The tasks plugin now publishes sp_task_ops through the
host, and delegate.c opens an entry before the call and closes it with status and
rough token count after - 'who is still running' becomes a fact on screen instead
of a guess.
Measured status line, live during a turn:
splinter 0.1.0 clock: 19:12:56 | ctx 4.0k | 12 tok/s |
4.0k in / 238 out | tasks 0/4 Delphinium 19178ms
Not yet observed: a delegate entry in the panel. Both test configs had no
reachable delegate (one endpoint dead, one with no defers at all), so the cycle
open -> close never ran against a real call. The wiring compiles and the task API
is exercised by task_start/task_list; the delegate half needs one live delegate to
prove.
Some work should not hold the conversation: a build, a test run, a delegate on
another host. plugins/tasks adds four tools -
task_start command, label? -> id, starts at once
task_list -> id, state, seconds, bytes, label
task_result id -> output and exit status once finished
task_kill id -> stop it
SPLINTER_TASKS_MAX defaults to 4, and a start beyond it is refused with the
reason instead of queued into an invisible backlog: a machine running twenty
shell commands at once is not faster, only harder to read. Output is capped at
1 MiB and says so. The sidebar gets a tasks widget that ticks once a second while
something runs, and the status meter carries tasks_running/tasks_max for the
status plugin.
Measured, through the model:
task_start -> 'started #1 (sleep_task) - 1/4 running'
task_list -> '#1 running 0s 0 B sleep_task'
limit 1: -> 'started #1 ... 1/1' then 'error: 1 tasks already running'
tools/tg-ask.sh sends an approval request to a Telegram chat and returns; the
gateway answers it, because one reader per chat is the whole point. Verified
against a stub curl (chat_id, text and token land in the right place) and it fails
cleanly when the token is missing.
The status line shows its segments now - the earlier empty bar was the Makefile
recipe that built kids.c into status.so, not a drawing bug.
A search box is the whole internet, so websearch and webfetch stopped being read
tools the moment a child can call them:
SPLINTER_KIDS_SEARCH=approve every search asks a parent (default)
SPLINTER_KIDS_SEARCH=allow searching is fine, other fetches still ask
SPLINTER_KIDS_SEARCH=deny no open web at all
webfetch only reaches hosts in ~/.splinter/kids/domains, and that list works in
every mode: a page a parent wrote down is allowed even when the open web is shut,
because a curated list is the safe ground. Everything else falls through to the
approval path every other change already uses.
Measured:
deny + websearch -> 'Verboten'
deny + webfetch netbsd.org (on the list) -> 'The NetBSD Project'
approve, no parent channel -> no fetch, the model answers without it
New host API for it: sp_host_add_status() takes a named renderer, and
sp_host_status_text() joins the segments with ' | '. The numbers a plugin shows
come from the harness through struct sp_meter - context used and window, session
tokens, cache hits, tokens per second, running tasks. A plugin that counted for
itself would drift from the harness within one turn.
plugins/status renders clock, ctx with a 24 column bar, cache, tok/s, tokens in and
out, cost and task count. Prices are configuration, not knowledge:
SPLINTER_CTX_MAX=32768 SPLINTER_PRICE_IN=0.3 SPLINTER_PRICE_OUT=1.2
Without prices the cost segment says nothing instead of inventing a number.
Also fixed: the status.so recipe compiled kids.c, so the plugin that loaded was
the kid mode with a different name - the reason seven status registrations
produced an empty line.
Known open: the segments compose (probe: 'clock: 17:28:14 | ctx 0/32.8k
[........................] 0% | 0 in / 0 out | $0.0000') but the bar still
draws only the title - not yet isolated.
Approval was a prompt on stdin: the terminal could answer, a phone could not, and
in the TUI the whole path was dead code that failed closed.
Now a request is two files:
~/.splinter/ack/pending/<id> the request (tool, args, why, expiry)
~/.splinter/ack/<id>.answer the answer (yes/no plus who)
The blocked process waits on the file and nothing else. Channels are notifiers -
a command per channel pushes the request out - and whoever reads the reply drops
the answer: the gateway, a phone, a script, another terminal. No second poller,
no lost Telegram updates, no special case per channel.
SPLINTER_ACK_CHANNELS=... comma separated commands, each gets the request
SPLINTER_ACK_TTL=120 seconds; a timeout is a no
splinter --ack <id> yes|no answer from anywhere
splinter --ack-list what is waiting
The terminal is one more channel, not a special case: a thread reads stdin and
drops the answer, while the main path waits on the file like everybody else. Kid
mode uses the same mechanism instead of its own command.
Verified: tests/test_ack.c, 7 checks - request, yes, no, who answered, timeout is
a no, answering a request that does not exist fails, and the pending list shows
the arguments. make check runs it with the other 21.
The daily budget was advisory: the gate refused tools and a system message asked
the model to close the day, but a chatty model answered anyway. So the core grew a
turn gate - a plugin can now refuse the whole turn before the model is called:
Fuer heute ist Schluss: 60 von 30 Minuten sind verbraucht. Morgen geht es weiter.
That sentence comes from the plugin, not from a model that was asked to obey. No
model call, no tokens, no way around it by talking.
Also fixed: one-shot mode printed only a newline when the transport streamed
nothing (a turn blocked before the stream), so the answer vanished. It is printed
when no bytes were streamed.
Website: third language, index.pt.html, generated from the same source; the
language bar on all three pages links all three. check_i18n now sees 51 keys in
three catalogues.
Kid mode plugin: a parent approves every action that changes something, a
whitelist lets the harmless ones through, and the model is told to stay
age-appropriate on every request (not once at the start, where it gets buried).
The core grew one hook for it: a gate. A plugin's gate sees tool, class and
arguments before the operator prompt and before the authorization class, and
answers allow, deny with a reason, or no opinion.
allowed -> the call runs, the operator is not asked
denied -> the model gets 'denied: <reason>' and cannot retry around it
silence -> the normal rules apply
A whitelist entry is '<tool> <glob>' in ~/.splinter/kids/allow:
run ls*
read *
Parents are reached through SPLINTER_KIDS_APPROVE_CMD, which gets the request
as its argument and answers with its exit status. No channel means no
mutating work at all - it fails closed, like the operator prompt it replaces.
A timeout is a no.
Measured: 'run' was denied with 'ein Erwachsener hat nicht zugestimmt
(abgelehnt)', the parent channel recorded the request, whitelisted 'ls'
went through.
Daily budget: SPLINTER_KIDS_DAILY_MINUTES, counted per step, stored per day in
~/.splinter/kids/usage, reset at midnight. When it is gone the gate refuses
every tool including reads.
pt_BR: a full catalogue (51 keys, 3 languages). Language detection now keeps
the region - pt_BR and pt are different catalogues and a Brazilian child
should not be handed European Portuguese - and falls back to the bare
language before English.
One-shot mode always installed a stream callback and then, on success, printed
only a newline - correct for the openai transport, which had already streamed the
text, and wrong for every transport that cannot stream. With --transport cli the
answer vanished: 'splinter -p ... --transport cli' printed an empty line and exit
0, so a claude or opencode backend looked like a model that had nothing to say.
The callback is now installed only when the transport publishes send_stream.
SPLINTER_CLI_CMD=hostname splinter -p 'sag hallo' --transport cli --plugin ...
kitt
Also: libsplinter.so and plugins/*.so were tracked, so every build produced a
dirty tree (and a conflict on any pull). They are ignored and removed from the
index; the binaries are rebuilt by make.
A delegate may name a host; the whole invocation then goes through ssh, so
claude, opencode or another splinter run on that machine. delegate and
delegate_parallel both honour it, and the report names the host like any other
model. The environment does not cross the jump: a cli delegate carries its
command explicitly (quoted, because ssh rejoins its arguments into one remote
shell command), and the remote host supplies its own keys.
Proven: a delegate with host=172.25.206.16 ran on olivia and answered through a
provider only reachable over the wireguard link.
--interview asks seven questions once - language, who you are, stack, style,
what never to do, sacred paths - and writes ~/.splinter/profile/<user>.md. Enter
skips a question and the skip is recorded as a skip. Starting the chat without a
profile prints a hint.
Two bugs found while testing: the stdin intake ate the interview's answers before
it could ask, and the question texts carried literal \n because of how the file
was written - both fixed and verified by running the interview with piped
answers and reading the resulting profile.
OLLAMA_KEY, OLLAMA_KEY_0.._N and CLAUDE_CODE_OAUTH_TOKEN, _0.._N are enough to
fill the harness: every Ollama key becomes a delegate and an exit in the ring,
every Claude token becomes a cli delegate running 'claude -p'. Several keys mean
several accounts; the ring walks them.
That is the workflow the tool exists for - a strong model plans and defines the
work, the local models implement it, delegate is the handover:
OLLAMA_KEY=... CLAUDE_CODE_OAUTH_TOKEN=... splinter --choose 'plane die arbeit'
claude-3 score=4 prio=10 task mentions 'plan'
OLLAMA_KEY=... splinter --choose 'implementier das'
ollama-2 score=3 prio=0 task mentions 'implement'
Delegates also take prio (tie-break, higher wins) and max_parallel (default 1,
a busy delegate says so instead of queueing silently). kind=cli with cmd=... runs
a program instead of an endpoint.
Keys travel in the environment, never on a command line or into a log.
test_config covers the scan, test_delegate the prio tie-break.
The default prompt says what the code cannot: read the documentation before you
build - README, AGENTS, man pages, the source itself - because a hack that works
against the documented way is a bug with good timing. Also: check what exists,
change the approach instead of repeating a failure, evidence over claims, never
invent output, answer briefly.
Placeholders {{os}}, {{home}}, {{cwd}}, {{model}} are filled at startup, so the
model is told which machine it is on instead of asking.
plugins/reminder puts five short rules back into the conversation every tenth
turn (SPLINTER_REMINDER_EVERY), in front of the newest user message. A rule read
once and buried under forty thousand tokens has stopped existing; one that comes
back is still a rule.
The bug that made both pointless: ag.host was never set, so sp_host_compact was
never called by the real binary. Every compactor - lcm, focus, reminder - was
registered, tested in isolation, and dead in production. 'Compaction happens
before the budget is judged' was true only in the tests.
Verified: with SPLINTER_REMINDER_EVERY=1 the request body contains [reminder]
(checked in wire.jsonl), and the system prompt arrives with the OS and no
leftover {{...}}.
Skills: ~/.splinter/skills plus any skills_dir from the config. Nothing is
preloaded and the system prompt does not grow - the model asks:
skill_search {query} returns names, one-line descriptions and paths;
skill_load {name} returns the file. Both read-only. A miss says what exists
instead of answering with silence.
Memory: memory_search and memory_add against mem0's REST API. Every request
carries user_id, taken from the account the process runs as ($USER, else the
passwd entry) - deliberately not a config key, because a setting is a thing to
forget and the process already knows who it is. A memory written by root is
invisible to lotherk.
Gateway: it ran without a stream callback, so a provider that only speaks SSE
answered with a stream the non-streaming reader could not parse. It now passes a
no-op callback - nobody to stream to, but the transport takes the streaming path.
tests: test_skills (search, directory form, miss, load, unknown name) and
test_memory (user id from environment and fallback).
The config moved to ~/.splinter/splinter.conf - next to the sessions, where the
state of this thing already lives - and every *.conf in the directory named after
it is read after it, in name order. A later file overrides an earlier one, an
unknown key is still fatal, and the error now names the file it came from.
plugins/ring is the exit ring: several ways to reach a model, walked in order
when one is rate limited.
exit = go | OpenCode Go | endpoint=... | model=...
exit = groq | Groq free tier | endpoint=... | model=... | key_env=GROQ_KEY
exit = local | kontron, lokal | endpoint=... | model=...
Only pressure moves the ring - 429, 5xx, 'rate limit', 'quota'. A dead host or a
bad key stops the turn, because a ring that treats every failure as 'try the
next one' hides real breakage behind a random provider.
Two things had to be fixed underneath: sp_openai_transport kept its context in a
static variable, so building several transports pointed them all at the last one
(now one heap context per transport), and plugins had no way to read the config
or the registry (sp_host_config, sp_host_registry).
Measured against two fake providers: the first answers 429, the ring moves on and
the second answers 'Antwort vom zweiten Ausgang.'; a dead port does not move it
and the error stands.
--resume loads the newest session in the directory into the conversation and
shows it. The first version opened a fresh id beside the old one and resumed
nothing while claiming to; it now picks the newest sess-*.jsonl before the id is
generated. Verified: a session that was told 'die Zahl ist 4711' and restarted
with --resume answered '4711' when asked.
plugins/mcp speaks MCP over stdio: handshake, tools/list, and each server tool
registered under its published inputSchema - not an empty object, because a tool
whose parameters the model cannot see gets called with nothing.
Two bugs the tests would not have caught without a real server:
* the reply id was matched with strstr(), and servers that write "id": 1 lost
the match - the client waited for a reply it already had;
* tool descriptions pointed into the parsed reply and dangled once it was
freed, so the request carried garbage bytes and the endpoint answered 500.
Also SPLINTER_DUMP_REQUEST=<path> now keeps the request body; finding that
garbage meant seeing what was actually sent.
Pressing Ctrl-C killed the harness. cbreak() leaves ISIG on, so the terminal
driver turned the key into SIGINT and the process died before wgetch() could
return 3 - the 'Ctrl-C cancels' line was a claim, and one keystroke disproved it.
raw() hands every byte to the program.
Cancelling a turn also only took effect between steps, so a request in flight
kept running to completion. The transport used popen(), which returns a stream
and not a process id, so there was nothing to kill. It now forks and execs,
keeps the pid, and both the read loop and the streaming loop poll with a 200 ms
timeout and SIGKILL the child when the turn is cancelled. Measured: Ctrl-C during
a streaming request returns to the prompt in 510 ms and the UI survives.
Temp files no longer use a fixed /tmp path: $TMPDIR, then /var/tmp. Three sites,
including the cli plugin, and they carry the conversation, so the path is now a
512-byte buffer built at runtime instead of a literal.
Four things, three of them reported by the operator.
1. Rows are counted from the real line structure. The old arithmetic
(strlen/cols) assumed one long line; a model's reasoning is full of '\n', so
the true height was far larger than the estimate and the text painted over
the answer below it - 'it just goes anywhere on the screen'. text_rows() and
row_offset() split on newlines first, then wrap. entry_lines() now measures
the string that is actually drawn ('role: text'), which also fixes the last
character of an entry being cut off (a truncated code fence).
2. Tool calls are visible: the agent's tool_begin hook fires before each call,
the UI drains the list under its lock and writes 'werkzeug: run
{"command":"echo a"}' into the transcript; the one at the top of the live
area shows the call while it runs. The reasoning entry is inserted before
those lines, so the transcript reads du, denkt, werkzeug, modell.
3. The chat pane has a black background, and the status line sits between the
pane and the prompt, the way Hermes shows it.
4. i18n is complete: every remaining literal in ui.c, main.c and the plugins
goes through the catalogue, including widget texts and format strings.
sp_td() carries a compiled-in English default, so a missing catalogue can
never drop a printf placeholder. tools/check_i18n.py runs in make check and
fails when a key used in the code is missing from any catalogue, or when a
catalogue key is used nowhere.
Seventeen test binaries green.
The goal is not configuration: it belongs to the conversation in front of you.
So it moved out of the config file and became a command.
- commands are an ABI now: sp_host_add_command / sp_host_command, so the UI
never needs to know a plugin by name. A leading '/' is never sent to the
model; an unknown command lists what exists.
- works in both modes: '/goal <text>' in the TUI and
'splinter -p "/goal ..."' (exit 0 on success, 2 on an unknown command).
- focus registers /goal (set, show when empty of arguments) and /recap (force
a reminder into the next turn, regardless of the five-turn cadence).
Fixed while testing it: the UI only repainted on a keypress, so a plugin widget
that ticks was frozen on screen - the clock showed the time from when the window
opened. The input read now times out after 500 ms and that timeout repaints the
sidebar and status line: clock, focus and cps are alive while you do nothing.
Fifteen test binaries green; test_focus covers the command path too: set, show,
force a recap outside the cadence, refuse an unknown command.
Long conversations drift, and a model ten turns in is deep in a detail while the
reason the session exists has scrolled away. focus puts it back: on every fifth
turn it inserts one system message with the goal and asks whether the last step
was closer to it.
Details that matter and are tested:
- one reminder per turn at most, even if compaction runs twice;
- inserted BEFORE the newest user message, so the model reads goal then request
and answers the request instead of treating the goal as a reply;
- nothing at all without a goal: no goal, no noise;
- the goal comes from the operator (config key goal -> SPLINTER_FOCUS_GOAL),
never from the model, and is truncated with a marker rather than eating the
budget it is meant to protect.
The host now counts turns (sp_host_turn) so a plugin can schedule against them;
that is what makes 'every five' mean five user turns and not five requests.
Sidebar shows the goal and the reminder count. Fourteen test binaries green,
test_focus drives the counter directly: turn 1 silent, turn 2 one reminder
in the right position, a second compaction in the same turn adds none, turn 3
silent, turn 4 the second reminder.
The sidebar counted characters and guessed tokens. The provider reports the
real numbers in the final chunk (prompt_tokens/completion_tokens, or
input_tokens/output_tokens), so both the streaming accumulator and the
one-shot reply parser now keep them, the agent sums them per turn, and the
sidebar shows '79 tok (in 344)' instead of an estimate. The estimate stays as
the fallback for endpoints that report nothing, and it is still labelled as
one.
Streaming: the OpenAI transport reads SSE over curl -N and reports deltas as
they arrive. Text goes to the chat pane, a tool-call start to the sidebar, and
a reasoning model's reasoning_content is shown dimmed above the answer instead
of being hidden - which is what made a 143 s turn look like a dead terminal.
Measured against kontron (Qwen3.6-35B, strata-poly): first byte at 11.6 s on a
short question, text growing visibly in the TUI at 7 s and 17 s on a longer one.
test_sse drives the accumulator with recorded lines: plain text, a tool call
split over three chunks, two calls in one turn, a broken data line, keepalives.
Twelve test binaries green.
Defects found while proving it, each fixed or stated:
- typed umlauts were dropped: the input loop accepted ASCII only. Every byte
above 0x1f is kept now and the line is redrawn from the buffer.
- setlocale() was never called, so curses had no encoding at all.
- the vendored NetBSD curses emits Latin-1 bytes for wide characters (ü ->
0xFC) while ncurses passes UTF-8 through; proven with a raw pty dump of both.
The UI therefore transliterates for display (gruen) and the conversation and
session log keep the exact UTF-8. The library defect is written down, not
papered over.
- an answer longer than the screen was skipped by the viewport and the chat
looked empty; draw_history now shows the bottom of the content, including
entries taller than the window.
First run against a real model (Qwen3.6-35B-A3B on kontron, strata-poly)
exposed two things a stub never would:
- our tool schema sent "properties":{}, which tells the model that no
arguments exist. Tools now carry a real JSON schema (echo/command/clock), and
the loop completes a tool round against the 35B: request 1 -> tool_call,
request 2 -> "Das Ergebnis ist: ping".
- an answer longer than the screen was not drawn at all: the entry did not
'fit', so the viewport skipped it and the chat looked empty. draw_history is
now a real viewport (total height, bottom-anchored, entries taller than the
screen start at the offset that puts their end on screen).
Steering: a turn runs on its own thread while the UI keeps reading keys. Enter
queues text the loop picks up at the next step boundary; Ctrl-C cancels; in a
single-step turn the text becomes the next message instead of disappearing.
Curses remains UI-thread-only. A dangling ag->cfg after the turn made a steer
run twice - the caller's config is now restored, and the session log confirms
one user line per steer.
Transports are plugins now (sp_host_add_transport / --transport). plugins/cli
makes any program the model: SPLINTER_CLI_CMD, run through /bin/sh, prompt on
stdin, stdout as the answer, 4 MiB cap, non-zero exit with the program's stderr,
empty output is an error. Verified with sed, with claude -p (2.9 s, answer OK)
and with cat.
Eleven test binaries green, test_cli included.
Compaction is not a flag in the loop; it is a compactor registered by a
plugin and run on the main thread before every request, with the whole
conversation in hand. Returning 1 means changed, 0 nothing to do, -1 failed -
and a failure is counted, not fatal.
lcm: deterministic lossy compression. Over budget, it keeps the leading
system prompt and the last six messages and inserts one system message that
says how many messages went, of which roles, and quotes the head of the
oldest dropped turn. No second model, so a run stays reproducible and costs
nothing extra.
cps: continuous parallel compression. The worker thread decides what would go
from an index it got under a mutex (role, size, 64 bytes of head per message)
and never touches the conversation; the main thread splices the prepared plan
in one pass when the budget is hit. The sidebar line shows applied/prepared
counts or a ready plan, so the claim is visible.
The limit is in both files: they can decide which messages go, not summarise
their text, because the text is not the worker's to read.
Ten test binaries green; test_compactor drives both against their real .so
files, including that lcm leaves the system prompt first, inserts the [lcm]
record at index 1, keeps the tail verbatim, and that cps needs two calls
(prepare, then apply) to change anything.