- plugins/self: what the session costs the machine - RSS, CPU, threads, fds
and io of the process itself from /proc/self/*, and the same (count, RSS,
CPU) for every process whose parent chain reaches it: run calls, MCP
children, delegates. Widget, /self and the session_usage tool; interval in
the plugin block (default 2 s).
- MCP server: the session tools. splinter_sessions, splinter_state,
splinter_models, splinter_agents, splinter_history, splinter_say,
splinter_open, splinter_model, splinter_agent, splinter_steer,
splinter_cancel, splinter_approve. Say starts a real turn and returns the
answer; a turn parked on an approval returns the question instead of
failing. Mutating tools obey --autonomous. `--daemon --mcp-server-listen`
runs the MCP server on a thread beside the Telegram daemon.
- the MCP server asks the engine for its registry on every call (a session
switch replaces it) and copies the tool name out of the parsed JSON before
freeing it (the first version compared a dangling pointer and answered
every session call with empty text).
- junction: "serving <endpoint>" - streaming answers carry no
X-Junction-Endpoint, so the plugin compares the route targets' ok counters
from /status between samples and names the one that grew, with its
last_ms. The header is still used when present (non-streaming). The
X-Junction-Endpoint of the plugin's own /v1/models probe remains a probe
fact in /junction only.
- transport: X-Junction-Endpoint is parsed from the response headers in both
the streaming and the non-streaming path and published through
sp_host_served_by(); sp_reply carries served_by.
- the curl rate guard (--speed-limit/--speed-time) is gone: it cut slow
router streams with "Less than 1 bytes/sec" even while keepalives arrived.
The overall -m timeout stays.
- focus: the sidebar shows "recap N, every M turns", and an applied recap
writes "recap applied (turn N, every M turns)" into the transcript (host
status messages are now drained during a turn; protocol clients get them
as entry events too). The initial goal announcement says so as well.
- tests: test_self, test_mcpsession.sh (real socket), test_focus status
messages, test_junction serving placeholder.
make check: all tests passed.
Two reasons the sidebar was useless: it named the route of the *configured*
provider model, not of the model the run was switched to (/model
deepseek-v4.1-flash kept showing qwen3.6-35b's kontron/kompute route), and it
repeated server counters (MCP servers, queue, requests, probe headers) that
have nothing to do with the conversation.
- sp_host_model()/sp_host_set_model(): the engine publishes the model it is
actually on; the engine sets it at plugin load, after /model and on every
state read. The junction plugin prefers it over the config.
- the widget is now only the model, the route from the matching rule (one
target per row, "!" when that target's probe fails) and "N/M up":
deepseek-v4.1-flash / route opencode-go0 / opencode-go1 / ... / 4/4 up.
Uptime, MCP servers, queue, requests, endpoint p95 and every response
header stay in /junction.
- widget text may use up to 8 rows (a four-target route plus model and
health is seven).
- test_junction: the widget must be exactly "m\nroute a\nb!\n1/2 up" and
must not repeat mcp/models/probe stats.
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.
plugin NAME { path = ... enabled = false key = value } loads the plugin
(shipped one for NAME unless path says otherwise) and hands everything else
to that plugin as its configuration, read with sp_host_plugin_config() or
walked with sp_host_plugin_config_at(). Nested blocks give dotted keys,
lists arrive comma-separated.
The mcp plugin's servers are now server ID { url | cmd | header } blocks
inside plugin mcp { }; the old top-level mcp NAME { } and the flat
plugin = path / plugins = [ ... ] forms keep loading.
Co-Authored-By: Claude Opus 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>
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>
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>
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.
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.
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.
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.
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.
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.
A plugin is a .so against libsplinter.so, exporting sp_plugin_describe().
The layout changes so there is exactly one copy of each symbol in the
process: all logic lives in libsplinter.so and both the binary and every
plugin link against it. Two copies would have meant two registries.
What the ABI offers:
- tools with the authorization classes the loop already enforces, so the
decision stays in the harness and not in the plugin;
- widgets rendered in the sidebar, one line per widget (name: text);
- a worker thread per widget with tick(), which may block, read files, wait
on sockets - and which cannot touch curses at all;
- sp_host_widget_text() as the only thread-safe write path: the host copies
the string under a mutex, so a stack buffer is safe and the UI never holds
a pointer a worker could free.
Error paths are part of the design: a wrong ABI number is refused with both
numbers in the message, a failed init is reported and skipped, a duplicate
widget name is refused, a tool without a run function is not registered, and
nothing is dlclose()d while a thread might be inside it.
Layout: chat on three quarters, sidebar on one (session, transport, theme,
last-turn numbers, widgets), status bar underneath. The clock example plugin
proves the path end to end - its widget publishes 11:45:23 into the sidebar
from its own thread.
Seven test binaries green; test_plugin loads the real clock.so with dlopen
and checks the worker actually published, plus every refusal above.