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>
Ten entries, written so the next session starts from evidence instead of memory:
the turn loop hitting its step limit, the unproven delegate task entry, the
unexplained claude exit 2, the untested telegram approval chain, markdown tables,
the never-measured 8k window, skills and memory, A2A, the stray node_modules in
~/.local/lib, and the website counting its own numbers by hand.
~/.local/bin/splinter was a shell script that sourced ~/.hermes/.env - another
program's secrets file, which has no business being read here. It is now what
'make install PREFIX=$HOME/.local' puts there: an ELF binary with an rpath of
$ORIGIN/../lib, so it finds libsplinter.so next to itself.
No wrapper, no LD_LIBRARY_PATH, no environment file. Keys come from the
environment the user exports; a delegate names the variable, never the value.
Verified from /tmp with the wrapper and ~/.splinter/env gone:
~/.local/bin/splinter -p 'sage nur: install-ok' -> install-ok
ldd | grep 'not found' -> 0
Also in this round: environment delegates are opt-in (env_delegates), the claude
entry is named after itself instead of its array position, and the docs say how
to install without root.
Decision, and the reason: the claude entry built from CLAUDE_CODE_OAUTH_TOKEN
does not work (the child exits 2 although the same 'claude -p' answers fine from
a shell), it duplicates the explicit claudecli delegate, and it appeared the
moment the wrapper started loading ~/.hermes/.env. An entry nobody wrote down,
that does not work, and competes for work is worse than no entry.
So env_delegates defaults to off:
env_delegates = 1 # then CLAUDE_CODE_OAUTH_TOKEN(_N) become delegates
Ollama keys are unaffected - they feed the exit ring, which is what they were for.
Also: the id counts claude delegates instead of the array position ('claude', not
'claude-5'), and its tags are its own (claude,cli,big,review) at prio 5, so it can
never take a planning task by accident.
delegate_list -> kontron, ocgo, ollama, claudecli, occli
env_delegates = 1 -> ... occli, claude
test_config pins both: 3 with the flag off, 4 with it on, and the id is 'claude'.
'claude-5' was not a stray line in a drop-in: it is the delegate built from
CLAUDE_CODE_OAUTH_TOKEN, which appeared when the wrapper started loading
~/.hermes/.env. The name was wrong:
snprintf(id, ..., "claude-%zu", c->ndelegates - 1);
'ndelegates - 1' is the position in the whole delegate array, so the first claude
delegate was called claude-5 the moment five lines were configured, and would be
called something else tomorrow. It counts claude delegates now: 'claude', then
'claude-1', 'claude-2'.
Its description also says where it comes from, so the list answers 'why is this
here' without a trip through the source.
kontron, ocgo, ollama, claudecli, occli, claude
The rogue thinking had one cause: the running line in the one-row input window
was drawn with user text appended, so it wrapped. A one-line curses window that
wraps scrolls the whole screen - the chat above moved, and every redraw put the
thinking somewhere else. The status text is truncated to the width now, the typed
text only draws if it fits, scrollok is off on both one-row windows, and the line
is cleared to the end.
Also: a UTF-8 character is one unit. Handing sp_ui_ascii a single byte of a
two-byte sequence produced 'Z??hler' where 'Zaehler' belonged; the transliteration
gets the whole character now and the offset advances with it.
Chat is append-only text: thinking, tool calls, answer and diffs are entries that
grow in place, drawn in order, scrolled by PgUp/PgDn.
New: delegate_list - id, tags, kind, prio, model, endpoint and what it is good
for; probe=1 asks every endpoint which models it really serves, so 'the config
says so' and 'the server answers' stay two different columns.
**bold** *italic* `code` # heading ``` fence
The markers are removed before anything is measured: a line measured with its
asterisks wraps in a different place than the one that is drawn, so height and
drawing now use the same stripped string. Each kept character carries an
attribute, which keeps a bold word bold across a wrap.
Fence blocks lose their marker lines and are drawn dim - an answer full of C
should look like code, not like three backticks around code.
Measured: zero '**' and zero '```' in a rendered answer, the list intact, the C
block readable.
One bug found by looking at the result: '_' was treated as an italic marker, so
the model name came out as Qwen3.6-35B-A3B-UD-Q8KX - a different model as far as
a reader is concerned. Only the asterisk marks italics now; underscores belong to
names.
[19:20:25] <lotherk> was ist ein semaphor? ein satz
[19:20:35] * Qwen3.6-35B-A3B-UD-Q8_K_XL is thinking: The user is asking in German
[19:20:38] <Qwen3.6-35B-A3B-UD-Q8_K_XL> Ein Semaphore ist eine Datenstruktur
The name comes from the environment and the configuration, not from a role label:
'<you>' was a literal, 'thinking is thinking' was a label talking about itself.
PgDn moved the scroll counter and never repainted - the screen agreed with
nothing. PgUp/PgDn now scroll ten lines, Shift+Up/Down one, and both repaint.
A tool's stderr went to the terminal and landed in the middle of the curses
screen. It is captured into the answer now ('{ cmd\n} 2>&1'), where the model can
read it and the UI stays intact.
Delegates for this machine (drop-in, keys by name only):
kontron 5 local 35B ocgo 10 opencode-go deepseek-v4.1-flash
ollama 8 cloud same model claudecli 9 claude -p
occli 9 opencode run --model big-pickle
A cli delegate no longer needs endpoint and model: claude and opencode bring
their own. The wrapper loads ~/.hermes/.env so keys are read, never copied.
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
Two read tools, because a harness that can read files but not the web invents
answers about anything current:
websearch query -> results as plain text
webfetch url -> page as plain text
curl is what every machine already has; a second HTTP stack inside the harness
would only be a second set of bugs. Tags are stripped in the pipeline, output is
capped at 20 kB, and an empty answer says so instead of pretending.
Backend: a SearXNG instance or anything that answers JSON, configured once with
SPLINTER_SEARCH_URL=http://search.hiddenbox.org. Without it, DuckDuckGo lite - no
key, no account.
Measured, both through the model, not by hand:
websearch 'NetBSD 11 release date'
-> www.netbsd.org/releases/formal-11/ ... NetBSD 11.0 ... 2026-07-30
-> NetBSD-11.1.html ... 2026-11-02
webfetch https://www.netbsd.org/
-> 'The NetBSD Project'
16 tools now.
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.
[17:14:55] <you> was ist ein semaphor?
[17:14:56] * agent is thinking ...
[17:15:10] <agent> Ein Semaphor ist ein einfaches Synchronisationsmittel
A timestamp in front of every line, the speaker in angle brackets, and reasoning
in the /me shape, so a transcript is still readable hours later instead of every
old line looking like it just happened. Entry height is computed from the same
prefix that is drawn, or the first line of an entry would wrap wrong.
The sidebar header carries the full date. When the day changes while splinter
runs, a marker is written into the chat once: --- 2026-11-09 ---
The gateway is the one reader of the chat, so it resolves approvals: 'ok 4711',
'no 4711', 'ja 4711', 'nein 4711' drop the answer file and confirm in the chat. A
second poller would have fought it for the same updates and lost replies.
Widgets freeze while a turn is processed. A clock that jumps every 500 ms next to
a streaming answer is noise, and the numbers beside it disagree with themselves.
The cache is refreshed again the moment the turn ends.
Tool calls were cut at 120 characters in the live line and 200 in the transcript;
the arguments are what makes a call readable, so they are no longer truncated and
the buffers grew to hold them. Measured: 'run {"command":"echo
dies-ist-ein-sehr-langer-befehl-...-abcdefghij"}' shows whole.
Layout: one column between chat and sidebar, one on both sides inside the chat.
Text at the very edge of a window reads like a terminal dump.
Also: the config line 'locale = de' forced German on a machine whose LANG is
en_US - removed, and the UI now says 'you:' and 'tool:' as it should.
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.
It was only on the Portuguese page, which is exactly the drift the generator is
supposed to prevent and does not: check compares languages, not section counts.
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.
Added in both languages: hosts and delegate_parallel with the real report block,
MCP in both directions (client and server, read vs --autonomous), and the three
small ways in - piped stdin, splinter -c for the last session in this directory,
and --interview writing the profile.
Generated, not hand-edited: gen_www.py writes both pages and make check fails if
one drifts from the source.
'make check' builds tests/test_<name> next to tests/test_<name>.c, so a plain
'tests/test_*' pattern silently hides new test sources too - the next test
written would have been invisible to git. The sources are un-ignored again.
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.
Every session records the directory it was started in (<id>.meta, cwd=). With
that, '-c' means the last session that happened *here*:
cd ~/src/splinter && splinter -c
A session from another tree is never silently loaded; if nothing happened in this
directory yet, it says so and exits. Verified in three directories - two report
no session, the one with history resumes.
folder_history gives the model the folder's memory instead of a guess: sessions
started there, newest first, with turn count and the last question.
--mcp-server-listen IP --mcp-listen-port N serves the registry over MCP
(newline-delimited JSON-RPC on TCP): initialize, tools/list, tools/call. Read
tools are served; mutating and destructive ones are refused unless the server was
started with --autonomous - a remote agent does not run shell commands here
because it asked nicely.
Proven with a real client on 127.0.0.1:8097: handshake answers splinter 0.1.0,
tools/list reports 14 tools, tools/call list returns the directory, tools/call run
is refused with the authorization message.
cat /etc/passwd | splinter 'explain the file'
stdin becomes context, framed and labelled with its size, so the question and the
bytes stay distinguishable. Binary input is reported as binary instead of being
sprayed into the request; the size is capped at 192 KiB with a truncation mark;
--no-stdin ignores the pipe. Without a prompt the input becomes the prompt.
Two orderings had to be fixed to get there: a bare argument is now the prompt
(splinter "explain this" works without -p), and the read happens before the
config's 'no prompt means start the chat' default - otherwise a pipe with no
prompt opened curses and died on 'initscr: Inappropriate ioctl for device'.
Verified through wire.jsonl: prompt and stdin both in the request, the framed
block present, and 'a\0b' reported as [stdin: 3 bytes of binary data].
Every task in a parallel handover now comes back as a header - task, model,
score, duration, exit status, size - followed by the task text and the answer,
and a summary line per model:
[parallel: 2 task(s), 12018 ms wall]
## task 1 | model slow | score 5 | 12018 ms | exit 0 | 75 B | requested tag 'slow'
## task 2 | model fast | score 5 | 16 ms | exit 0 | 74 B | requested tag 'fast'
## summary
- slow: 1 task(s), 12018 ms total
- fast: 1 task(s), 16 ms total
Three bugs found by running it:
* the wall clock mixed CLOCK_MONOTONIC with time(), which produced a negative
total;
* completion was detected through POLLHUP only, so a fast job was marked done
when the slow one finished - both reported 12018 ms, which is precisely the
number that must differ;
* the children's own 'splinter: ...' lines landed in the answer, so every
delegate looked like it had commented on itself.
Fixed with non-blocking reads plus waitpid(WNOHANG), and a filter for the child's
own diagnostics.
delegate_parallel takes a list of tasks. Each one picks its own model through the
same scoring as delegate, up to eight are spawned at once, and their pipes are
picked up by one poll loop - nobody waits behind the task in front of them.
Measured against a provider that takes 12 s per answer: two tasks returned in
12 s total, and the observation says so ([parallel: 2 tasks, 12 s]); serial
would have been 24.
max_parallel still applies per delegate: a full delegate skips its task with a
note rather than queueing silently - verified with two tasks on one delegate at
max_parallel 1, where the model reported that only one ran.
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 page was hardcoded German while the program has catalogues - the same
inconsistency the operator keeps finding, this time in the docs.
tools/gen_www.py now holds the skeleton and both languages and writes
index.html (de) and index.en.html (en). A key that exists in one language and
not the other is a hard error, and 'make check' runs the generator with --check,
so a page that no longer matches its source fails the build instead of living on
as a stale copy - exactly the rule the program's own catalogues follow.
Verified: both pages generated (11158 / 10888 bytes), xmllint --html clean, and
both serve 200 on :8099 with a language switch in the header.
The old page described the loop and the plugin ABI and never answered the
question it exists to answer: this is an agent harness with a chat UI, like
Claude Code or opencode, ours to change. That comes first now.
HTML 4.01 Strict, one file, no JavaScript, no fonts to fetch. Every number on it
is taken from the build: 9125 lines, 248568 bytes, 21 test programs, 8 plugins,
42 palettes. The termnial block is a real transcript including the diff.
Served from src/www on :8099 - 200 on loopback, WireGuard and LAN.
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).
Sending 'typing' every four seconds while a turn runs was in the code and never
on the screen: the API base became overridable and the URL format lost the token
on the way, so the gateway could not poll at all. Fixed, and proven against a
fake Telegram API with a slow provider behind it:
get /bot.../getUpdates
typing 00s, 04s, 08s, 12s (one per four seconds, whole turn)
message <answer> (typing stops with the turn)
SPLINTER_TELEGRAM_API now overrides the API base, because a gateway you can only
test in production is a gateway you test in production.
Logs: every session keeps ~/.splinter/logs/<id>/session.log (readable, in order,
nothing truncated) and wire.jsonl (request bodies and replies). The agent records
the user's words, the answer, the reasoning, every tool call with arguments,
every observation, failures, and the transport records the wire.
Slash programs: anything executable in ~/.splinter/commands/ becomes /name. It
gets the rest of the line as one argument and its output goes to the *model* as
context, not to the operator as a reply. Two bugs found by trying it: the
directory was derived from --session (so a session elsewhere found nothing), and
the whole slash branch only ran when a plugin host existed, so without plugins
/uptime was never even looked at.
Telegram: a typing thread sends sendChatAction every four seconds while a turn
runs - and only while a turn runs, not while a plugin answers a slash command.
The gateway no longer appends to the session twice (the agent already does).
docs/ROADMAP.md lists what is still open, in the order it should be done.
--daemon long-polls getUpdates, runs one turn per message and replies. The token
comes from ~/.splinter/telegram.token (0600) or SPLINTER_TELEGRAM_TOKEN, never
from an argument: arguments end up in ps and in shell history.
telegram_allow lists who is answered, comma separated, nobody by default - an
empty list is a refusal, not an open door. Unknown senders are logged without
their text.
The loop survives a failed request instead of dying on it, and keeps no state
beyond the session: a restart re-delivers the last update, which costs one
duplicated answer and never a lost message.
test_telegram covers the token paths (file wins, environment as fallback, empty
file is not a token). Verified against api.telegram.org: the token works and
getMe answers hbx_splinter_bot. Sending needs the user to write first - a bot
cannot start a chat, the API says 'chat not found'.
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.
A delegate is a line in the config - id, what it is good at, tags, endpoint,
model. No profiles: a profile is a directory of files, and this needs a line you
can read at 2 a.m.
The delegate tool takes a task and optional tags. The pick is code, not a guess:
requested tag 5, tag in the task 3, description word 1, ties to the earlier
entry. The observation opens with the choice and the reason, and --choose prints
the same decision without running anything:
coder 7 task mentions 'code'
quick 5 task mentions 'chat'
coder 3 task mentions 'refactor'
The child is splinter itself in one-shot mode - same tools, own context, own
endpoint and model. Classed destructive, because it runs a whole agent; the
operator approves the delegation once.
test_delegate pins the decisions, including the two cases that must not pick
anything: no matching tag and no delegates at all.
A mutate tool that says 'wrote 23 bytes' tells the operator nothing. write and
edit now put a one-hunk diff into the observation - common prefix and suffix as
context - so the model sees what it did and the transcript shows it as its own
'anderung:' entry.
One hunk, not a general diff algorithm: a tool changes one place, and the point
is to see which. Verified against kontron: asking for an edit produced
@@ -1,2 +1,2 @@
zeile eins
-zeile zwei
+zeile zwei geaendert
and the file on disk really was changed.
--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.
The harness had echo, run and clock - a chat with a shell. A coding agent needs
to look at a file, change one, find something, list a directory:
read (read) numbered lines, offset/limit, refuses binary, says where it
stopped
search (read) literal search over a tree, capped at 100 hits
list (read) a directory
write (mutate) up to 4 MiB
edit (mutate) exactly one occurrence; a non-unique 'old' is an error
run (destructive, already there)
Approval was dead code in the chat: ask_operator() read stdin, which a curses
program cannot do without eating its own keystrokes, so with --autonomous off
every mutate tool was silently denied ('fail closed'). The agent now asks through
a callback; the UI puts the question in the prompt line and parks the turn
thread on a condition variable until y or n arrives.
Measured against kontron: prompt appeared 6 s into the turn, 'y' ran the tool and
the answer carried its output; 'n' left the target file absent and the model saw
'error: denied by operator'.
test_builtin covers the refusals, not just the happy path: ambiguous edit writes
nothing, binary read reports instead of spraying, missing arguments say what is
required. README no longer claims there is no tool-call parser and no compaction.
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.
The last literals were the prompt ("> "), the millisecond format and the
placeholder for a missing session id. They are keys now.
More important than those three: the gate was too weak. check_i18n only proved
that keys used in the code exist in the catalogues - a literal drawn straight
into a curses window passed unseen, which is how 'du' or 'denkt' could have
been hardcoded without anyone noticing. It now scans the drawing calls
(mvwaddstr, mvwaddnstr, mvwprintw, waddstr, wprintw, winsstr) and fails on any
literal argument, and it checks that every role passed to add_entry() is one of
the known identifiers that have a role.<name> label.
Proven red before trusting it: with a literal prompt and a role 'benutzer'
injected, the gate reported both and returned 1; restored, it passes. The gate
also runs in make check now - it had been added to a target that no longer
existed.
The reasoning lived in a fixed box at the bottom of the pane and became an entry
when the turn ended, so it started in the wrong half of the screen and then moved
up under the message - exactly what was reported.
A streaming turn is now two entries that grow where they belong: 'denkt' is
created under the last message on the first reasoning chunk and rewritten on
every tick, tool calls are appended between it and the answer, and 'modell' is
created on the first answer chunk and grows in place. At the end nothing is
inserted, nothing shrinks: the reasoning keeps its full text, which also removes
the last jump (the 400-character tail made the block collapse and everything
below it slide up).
The tick dropped to 100 ms while a turn runs, so the text arrives in readable
steps. PgUp/PgDn now scroll the transcript itself instead of a box that no
longer exists.
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 reasoning wandered around the screen because its region was computed from
the text length: every new chunk changed the height, so everything above it
moved. The live block now has fixed heights - 8 rows reasoning, 5 answer, 1 tool
line - chosen once per turn. Verified against kontron across three captures of
one turn: the reasoning starts on the same row every time, and when the answer
arrives it lands in its own region below.
Up/Down walk the input history like a shell: kept in memory and appended to
<session_dir>/history, loaded at start, consecutive duplicates collapsed, 128
entries with the oldest dropped. Tested by typing two lines, walking back with
Up twice, and reading the file.
Not gettext: this harness is meant to start in ten years, and gettext needs
msgfmt at build time and .mo files at runtime. So catalogues are 'key = text'
files in share/locale, read once at startup.
- language from the config key LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=, else SPLINTER_LOCALE, LC_ALL,
LC_MESSAGES, LANG; regional variants are stripped (de_DE.UTF-8 -> de);
- catalogue search: $SPLINTER_LOCALE_DIR, the executable's own directory (so
works from any cwd), the source tree, /usr/local/share;
- a missing key falls back to English, and a key that exists nowhere is shown as
itself - an empty label hides a bug, a visible key does not;
- UI labels, roles, sidebar headings, status line, command errors and the shell
escape all go through sp_t(); plugins can translate theirs the same way.
test_i18n loads both catalogues from share/locale, checks lookups, the
fallback chain, printf placeholders, and that de.msg covers every key en.msg
has - a translation that silently misses half the UI is worse than none.
Seventeen test binaries green.