One session line is one JSON object, and an observation can be tens of KiB.
recall read with an 8 KiB fgets, so a match in the middle came back without its
context and a long hit was printed in full. getline now reads the line whole; a
hit shows 1200 bytes of head and 400 of tail with the cut size, and the whole
answer stops at 12 KB. test_compactor drives it: with the cap raised it fails on
both the marker and the bound, with the cap it passes.
The i18n checker listed 18 keys nothing uses (the interview/plan/model
leftovers). They are gone from all three catalogues; catalogs.c is regenerated
from them by the build.
check_i18n: ok. make check: all tests passed. make check-asan: all 39 clean.
The MCP plugin's reconnect thread was detached: shutdown killed the child and
returned, so the thread could still be reading into its line buffer (up to
16 MiB) and could call sp_host_add_tool() into a host that was being freed -- a
use-after-free waiting to happen, and the reason three leaks were suppressed in
tests/asan.supp (read_line, register_tools, connect_server).
Each server now keeps its pthread_t, init creates it joinable, and shutdown
waits (bounded, 5 s) for every thread to return before joining it and freeing
its state. teardown() frees the line buffer for the HTTP transport too (it was
freed only for stdio) and closes the stdio pipes even when the child was
already reaped.
The registered tools leaked for a second reason: sp_registry_add copies the
struct, not the strings, and sp_registry_free freed only the arrays -- the
prefixed name, the description, the printed schema and the toolref of every MCP
tool were lost with the registry. struct sp_tool gets a dispose hook; the
registry calls it for each tool, and the MCP plugin frees what it allocated (the
default schema is strdup'd now, so ownership is uniform). Builtins and the
gateway's tools leave it NULL; every positional initializer got the new field.
tests/asan.supp is empty. make check-asan: all 39 test binaries clean.
make check: all tests passed.
Everything that was uncommitted in the shared tree, in one commit because the
changes are interleaved across the same files (lcm, engine, frontend, locales).
lcm: a continuation prompt is not the task. After /resume the newest user
message is "Continue with the task ...", and pinning it kept the keystroke
while the question it continues was cut away -- measured: a resumed session
woke up with the prompt, one tool call and its error, and no task at all. The
pin now skips the harness's own continuation prompts, so the real question is
pinned again. test_compactor drives it: with the skip disabled the task is
lost (red), with it the task comes back after the summary (green).
engine: /self-check and the exact tool-argument parse are in a1794fb; this
commit carries the tests for them (a failed tool observation must appear in
the self-check prompt; mcp_parse_exact rejects two objects in one string) and
the i18n keys the new code uses: cmd.script.*, main.no_profile, tg.busy,
tg.interview.running, ui.agent_busy in all three catalogues.
The rest is the in-flight work from the shared session: engine/frontend,
plugins, telegram/a2a, and their tests.
make check: all tests passed; check_i18n ok, 204 keys in 3 catalogues.
Prompt box
- The input wraps at the window width and grows from one to five rows;
beyond five it keeps the line with the cursor visible and scrolls inside.
The conversation and sidebar shrink instead of the prompt being cut.
- Shift+Enter inserts a newline. It accepts the CSI-u and xterm modifyOtherKeys
sequences and Alt+Enter; modifyOtherKeys is enabled at start and disabled on
exit/signal. Enter still sends.
- History entries are folded to one line so the line-based history file stays
readable.
- Mouse wheel scrolls the transcript (3 rows) in the prompt and during a turn.
Cache plugin
- New plugins/cache/cache.so: sidebar block and /cache command with the
provider prompt-cache hit rate (last and session), cumulative cached tokens,
and the junction cache from X-Junction-Cache plus its /status cache object
(entries, hits, misses, bytes, ttl, joined).
- sp_meter/agent/engine now carry cached_total; the UI fills it.
- plugin cache { } added to the user config.
Junction judge schedule
- The transport parses X-Junction-Judge-Next/-In/-Next-Step/Every/Target/
Model/Cache from every chat response and publishes the last one on the host.
- The junction widget and /junction show "judge next in N ... via ... cache
..." when the provider sends it; no stale schedule after a plain model.
- X-Junction-Cache is parsed even when no judge headers are present.
Self plugin
- Human labels and units: memory, threads, open files, children, bytes read/
written; "children" instead of "kids".
Errors
- An in-stream error event now reads "provider error: ..." instead of "sse:",
because it is the provider/router talking, not the stream parser.
make check: all tests passed.
/resume compacted N messages to N+1 every time. With keep_tail 6 and a short
history, the cut removed one message, then added the summary and the pinned
question: net +1. The context never shrank and the next /resume repeated it.
A message rewrite now happens only when it removes more messages than it adds
(drop > 1 + pinned). If the cut is that small, the old tool-output trim is kept
and the message list is left alone. test_compactor covers the 8-message case
(no change, no [lcm] row) and the 10-message case (10 -> 9).
make check: all tests passed.
/model and the other slash commands are not messages to the model. In steer
mode a line starting with '/' or '!' now goes to the engine instead of
steer():
- /model opens the picker at once. A selector chosen while a turn runs is
remembered and applied between requests (tool_end) or at the end of the
turn, because replacing the transport under a live curl frees the context
the request is reading. The note says the switch follows the request.
- /status, /cost, /usage, /sessions and ! answer immediately.
- /new, /reset, /compact, /agent, /connect say "not while a turn runs" and
are not sent to the model; /open says the same.
- only a command that produces a prompt (e.g. /continue) is handed to steer().
The protocol input command allows slash commands while busy (plain text still
gets "a turn is running"), so --attach behaves the same.
The picker showed a phantom "main" provider with -m provider/model: the
selected endpoint was copied into the config as main. It is only main when no
configured provider owns it, so the row is now "junction qwen3.6-35b-judged".
The stale ~/.splinter/splinter.conf.d/90-model.conf from the old global /model
was moved aside; it was the other source of that "main" row.
The mcp widget names every server and its state - "junction connected",
"files disconnected" - instead of counting tools.
make check: all tests passed.
- lcm: the sidebar widget and /status segment show the context, the number of
compactions, messages and bytes of the last cut, and how many old tool
outputs were trimmed. The counters are the compactor's own, not an estimate.
- cost: a provider-reported USD cost (usage.cost/cost_usd) is carried through
sse/openai, the agent and the engine. /cost reports it with the cache share
and splits judged from plain turns; the notes say that an upstream judge is
not visible in the provider's usage. The status plugin and junction prefer
the reported number over list-price arithmetic.
- curses: the running turn's seconds moved from the input line to the status
bar. Notes and errors are transcript rows below the cause, never text in the
input line or the status bar; a failed backend request is a status row and is
retried by the agent. The steer prompt is only "steer> " and what was typed.
- model: /model probe works in the chat. The picker lists the configuration at
once, then asks the endpoint the session is on what it serves and adds those
models, so a router's whole menu is selectable. provider/model selectors now
apply the right provider instead of becoming a model name. The choice is
written to <session>.model and restored when that session is reopened; /new
carries the current model into the new session.
- sidebar: plugin titles are bold and underlined (this curses has no italic
attribute), with a rule between the plugin blocks.
- run/cli: a command timeout is an idle window. Every chunk on stdout or
stderr resets it, and the process is asked with waitpid(WNOHANG) whether it
is still there before the window is extended. A long build that keeps
reporting progress is no longer killed for being long; a silent hang is.
- config: ';' separates settings on one line, so
plugin lcm { keep = 6; tool_trim = 8192 } parses as two keys.
- tests: lcm widget/status counters, one-line config blocks, session model
restore and /model probe, cli idle timeout with a talkative and a silent
command, run output reset, and the UI status/retry rows.
make check: all tests passed.
A long tool loop pushed the question out of the six-message tail; the model then
wrote 'The compaction dropped the user's actual question' and recovered it with
recall (session 1794952419). The newest user message is now pinned and put back
right after the summary, so the task survives any compaction. test_compactor
covers it.
Tool observations are the bulk of a long conversation. Before lcm drops any
message it now cuts every old tool output to a head and a tail with a marker
quoting its first line; the middle stays in the session log, where the recall
tool finds it. Only when that is still over budget are messages dropped, so a
conversation often keeps all its turns and only loses the middle of old
outputs.
- plugin lcm { keep = 6; tool_trim = 8192 } sets the verbatim tail and the cap
per old observation (0 turns the trim off).
- the compacted summary says when tool output was cut too.
- test_compactor: a 20 KB old observation is trimmed, nothing is dropped, and
the marker points at recall.
- docs/CONFIG and docs/PLUGINS updated; the user config uses 6/8192.
make check: all tests passed.
- a stream that carried only reasoning and then ended without an answer used to
abort with no retry: guarded_stream counted every chunk as "already
produced". Only answer text and tool calls block a retry now; the thinking
may repeat, a lost turn may not. test_agent has a stream that thinks, fails
once and answers on the second attempt.
- /compact [tokens]: runs the compactors now (default: compact_target, else
8000 tokens) and reports messages and bytes before/after.
- compact_threshold / compact_target in core (tokens): once the last request
was larger than the threshold, the next request is compacted to the target
before it is sent. 0 disables either.
- lcm gains a read tool `recall`: case-blind search in the session log for
what compaction dropped from the prompt.
- user config: compact_threshold = 32000, compact_target = 12000.
- README/CONFIG document the command, the two keys and the cache trade-off.
make check: all tests passed.
- plugins/tmux, plugins/planner and plugins/sysinfo are gone (plugin list,
Makefile rules, tests, docs). The config no longer loads them; the stale
.so files were removed from the install tree.
- plugins/tasks is plugins/processes: plugin name "processes", widget
"processes", tools process_start/process_list/process_result/process_kill.
The sidebar now lists only running work: a finished task keeps its output
in process_result but stops taking a row forever.
- the dead planner link in the delegate (link_plan_quota -> command "tasks")
is removed with the planner.
- tool call rows are no longer capitalised: "run ls -l", "read src/x.c" as
the model sent them, not "Run "/"Read ".
- tests updated (delegate panel expects no finished row, engine/UI expect the
lowercase call row, secrets/delegate use the processes plugin and tools).
- the user's config gets a Delegate/Scheduler section: the three providers
carry review/plan/docs tags and keep max_parallel=2; plugin scheduler stays
loaded so waiting jobs are retried.
make check: all tests passed.
- 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 session showed the last error as "retry 1/3 in 5000ms: openai: stream
ended with no answer" with nothing on screen: the turn looked hung for the
five seconds, then either answered or failed. The retry itself was fine; the
operator could not see it.
- sp_agent_config gains note()/note_ctx: a status line for the operator, ""
clears it. The engine turns it into SP_EV_NOTE, so curses shows it in the
steer line and protocol clients get the note event.
- agent_request() emits "retrying in N s: <reason>" before sleeping and clears
it when the attempt answers or the retries are exhausted.
- i18n ui.retry_note in en/de/pt_BR; README says the wait is visible.
- test_agent: the note callback must have seen "retrying in" on the recovery
case.
make check: all tests passed.
The widget printed "endpoint=opencode-go" because that is the
X-Junction-Endpoint header of the plugin's own /v1/models probe, which
junction routes there by a path rule. It says nothing about where the
conversation goes, and the operator's qwen3.6-35b is routed to kontron and
kompute0..2 - so the line was wrong, not just imprecise.
- read the active model from the config (sp_usage_active -> provider model)
and match /status' rules against it: exact model > glob > catch-all, rules
with a path are another route. The result is the route line:
"route kontron! kompute0 kompute1 kompute2" ("!" = that target's own health
probe is not ok).
- /junction shows model, route and "route health: N/M up, down: ..."; the
/v1/models header block is marked as the probe's route, not the session's.
- the header stats label the probe values (probe-ms=, probe-cache=) and no
longer print the endpoint header as if it were the route.
- side_text(): wrap one line at a time and let a continuation use up to three
rows; passing a multi-line string to one mvwaddnstr() double-counted rows
and cut "route ... kompute1 kompute2" in half.
- test_junction: fake /status gains rules and per-endpoint probe_ok; the test
sets the run's model ("m") and expects "route a b!", "probe-ms=12",
"route health: 1/2 up, down: b" and no "endpoint=" in the stats.
make check: all tests passed.
- /model in the curses chat opens a picker: Up/Down, typing filters by
provider/model, Enter takes the selector, Esc cancels. The list comes from
the backend (sp_engine_models -> sp_provider_choices), not from a text
scrape; the socket has a `models` command, so --attach gets the same picker,
and the switch is still the ordinary "/model <selector>" input.
- steering: Enter during a turn now says so twice - a "steering queued: ..."
row in the transcript and "Ns steering queued (n) steer>" in the input line
until the step boundary picks it up; a rejected steer is an error entry.
- input lag: typing during a turn is echoed immediately (the input line is
redrawn per key, not at the next 100 ms frame), and the history is only
repainted when its generation changed, so a streaming turn no longer
repaints the whole transcript on every clock tick.
- sidebar: the first line of every widget is bold, like its heading, so a
plugin block has a title instead of a wall of small print.
- junction plugin: keeps every response header from /mcp, the status route and
/v1/models; the widget shows the X-Junction-* routing stats, /junction lists
all headers per source. It reads the status aliases (/status, /v1/status,
/queue, /v1/queue) and remembers the one that answered, parses queue,
endpoint p95/exhausted counts, and counts the models (/v1/models, probed on
its own slower interval because it goes upstream).
- SSE: blank lines no longer abort a pretty-printed object, a truncated tail
is dropped instead of failing the turn ("incomplete data line" is gone), and
a [DONE] with a fragment clears it.
- retries: a request that fails before anything streamed (connection, missing
status, 5xx) is tried three more times, 5 s apart; 4xx is not retried, and
after the first chunk the error is reported instead of printing the answer
twice. Ctrl-C ends a wait at once; SPLINTER_RETRY_WAIT_MS overrides the wait.
- tests: test_sse (split object across events, truncated tail), test_agent
(four 500s = four requests; two 500s then an answer), test_engine and
test_protocol (models list), test_junction (headers, aliases, models),
test_ui (/model picker), test_focus (status keys).
make check: all tests passed.
- plugins/junction: evaluates the X-Junction-Mcp header and /status; the
sidebar widget, the "junction" status segment, junction_status and
/junction show uptime, MCP-server health, queue and request counts.
The url/header come from the plugin block, the mcp junction server or
SPLINTER_JUNCTION_URL/TOKEN; the key is never printed.
- theme: two flat themes. light is a white page with black text, dark the
same inverted; chat, sidebar and input share the page, the status line is
the one separate surface. Each CDE palette keeps its own rules.
- curses: the sidebar uses the theme's own text on its own background
(white/black) instead of white on a darkened surface; the one column
between chat and sidebar is painted, so a white theme has no black seam.
- focus: the goal goes into the first prompt (config, resume, planner), and
every goal-carrying text asks the model to end with GOAL_COMPLETE. The
marker is read from the conversation and the session log and recorded as
goal_state=succeeded in the session meta; /goal and the sidebar say
[done], reminders stop, a new goal opens a new one.
- tests: test_junction (fake server, header identity, no colon in widget
continuation lines, no key in the output), test_focus (announcement,
completion in the compactor and from the tick, persisted state),
test_theme (flat themes, list order).
make check: all tests passed.
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.