The interview note built its buffer with the translation as the format
string:
snprintf(note, sizeof(note), sp_td("interview.saved", ...))
A '%' in a translation would be read as a conversion - clformat-security named it. The text goes through "%s" now.
tools/check_i18n.py grew the guard that keeps the shape out: a sp_t()/
sp_td() call may be the format only when arguments follow it; with none
behind it the conversions are unintended.
clang -Wformat-security: 1 -> no warning at that call
check_i18n with the bug restored: fires, rc=1
check_i18n with the fix: ok (229 keys, 3 catalogues)
make check: all tests passed, rc=0
The /sessions rows and the /model rows share one list struct, and the list was
sized with SP_MODEL_CHOICES (96) because /model was its first user. The session
side answers with up to 100 rows (FOREIGN_ROW_MAX in foreignopen.c, the v[100]
in sp_session_list's callers), so the source line said "claude (100)" while the
last four rows were dropped by pick_add without a word. SP_PICK_ROWS (128)
sizes the list on its own.
Evidence: tests/test_ui.sh builds a directory with 100 sessions, filters to the
oldest one and expects its row. With SP_PICK_ROWS 96 the check FAILs
("FAIL shows sess-1795000001-1-1"), with 128 it passes. make check: all tests
passed.
sp_engine_switch() copies the options the run was started with, and a run
started with --claude carries from_foreign. Two branches (a foreign
"claude:<id>" pick and the recovery path back to the session we had) reset
it, the branch for an ordinary session id did not - so a plain /open <id>
in a --claude run ignored the pick and imported the newest claude session
over it. With no plugin loaded that import failed and sp_engine_switch
returned -1 with *ep already NULL, which the caller then dereferenced.
from_foreign is now cleared once, before the branches, and again on the
recovery path (which would otherwise re-import instead of going back).
Evidence: tests/test_engine.c sets from_foreign="claude" on the template and
switches to an ordinary id. Without the fix it FAILs and segfaults (rc=139);
with it the test is green. make check: 21 suites, 0 failures.
tests/check_asan.sh: 45 binaries clean.
Three bugs in the /sessions picker, all of them found by review and all of
them visible on the screen:
- sp_engine_sources() hard-set every foreign source's count to 0, so the
picker offered "claude (0)" while 82 rows were behind it. The count now
comes from the same listing the picker shows.
- sp_foreign_sessions() hard-set each row's date to 0, so every foreign
session drew as 1970-01-01. The plugin prints "%Y-%m-%d %H:%M" and the
row's first column is parsed into epoch seconds.
- The foreign plugin's list tool queried with its configured default
(limit = 25) no matter what the caller asked for, so asking for 100 rows
returned 25 and a store with 290 sessions looked like one with 25. The
caller's limit now reaches the SQL.
Proof: tests/test_foreignopen.c asserts count == 1 and mtime > 1600000000
against a fixture store; reverting either fix makes both checks fail. Live
over the socket, before: [('splinter', 100), ('claude', 0), ('opencode', 0)]
with mtime 0 on every row; after: [('splinter', 100), ('claude', 82),
('opencode', 100)] with mtime 1795387200. sqlite3 counts 290 opencode
sessions and 82 claude files, so the numbers agree with the stores.
make check: 21 suites, 0 failures. check_i18n: 229 keys in 3 catalogues.
`/sessions` printed a list of ids; the operator then typed the id into
/open. The list was the wrong shape for a thing you pick from, and the
foreign stores (claude, hermes, opencode) were not in it at all - their
sessions were only reachable through the model's import tool.
Now it is a picker in two steps: the sources first (`splinter` and every
foreign store that has something), then the rows of the chosen one. A
foreign row's id is "claude:<id>", which sp_engine_switch() already reads
as an import - so picking it loads and continues that session, exactly
like `/open claude:<id>` typed by hand.
The picker got one shared implementation while it was open: pick_run()
with a value/label list, a configurable title and two hint lines. /model
and /sessions draw the same way now instead of two copies that could
diverge on Esc, resize and the filter. One window is held across both
steps, so a quick double Esc leaves; with a window per step the second Esc
landed in a window that was already gone and the picker stayed open.
Over the socket the same two steps exist: `{"cmd":"sources"}` and
`{"cmd":"sessions","source":"NAME"}`.
Tested: make check, all suites green (test_engine, test_protocol,
test_ui against a real tmux pane, 229 i18n keys in three catalogues).
/learn is an engine command like /self-check, so it works in the TUI, in
-p and over the socket. Without an argument it hands the model this
folder's session list (newest first, with the recap line of each) and the
path of the conversation files, so it can read a session page by page with
read instead of firing dozens of session_search snippets. With an argument
it learns about that topic and the session list is context, not the task.
The prompt names the write tools the engine really has ('one ending in
skill_create, memory_add, page_write, task_create...'), taken from the
registry, because a live run showed the model hunting 'which memoryd' for
tools it was never given. When no write tool is registered it says so and
asks for a suggestion in the answer instead of inventing a call.
Proof: tests/test_engine covers both branches (no argument names a
session of the folder and a registered write tool; a missing write tool
is named as missing). 'make check' passes. Live against junction/beam-free
the model went from '54 session_search snippets, no write' to reading the
session file with read; the run stopped at my 900s timeout, no writes yet
- the prompt hint is in, the end-to-end write is still unproven.
The engine's note callback pushes onto the screen event queue. A gateway has
no screen, so the queue was never read: five corrected tries five seconds
apart were twenty-five seconds of silence in Telegram, and the operator saw
nothing until the turn finally answered.
The gateway now installs its own note callback and sends the line into the
chat the turn came from. It is safe on the polling thread because the turn
runs there itself, not on a worker.
The two lines a broken call leaves behind were hardcoded English while the
transport retry was already translated; both keys are now in en/de/pt_BR.
Tests: test_gateway sends "kaputt", the fake answers with a tool call whose
arguments are not JSON, and the chat must carry
"kaputter Tool-Call, neuer Versuch in 0 s (1/5)" and still end with "fertig".
Counter-check: with the engine's own note restored the same run says
"FAIL a broken call is announced in the chat". make check green (273 s),
check_asan green over 45 binaries.
Konrad saw "agent: model sent malformed tool arguments" on the Telegram
daemon again and again. The retry existed, but it was useless: three
attempts in a single millisecond, each with the identical prompt, so the
model answered with the identical broken call. After the third the turn
died with an error nobody can act on, and the session lost the work.
Now:
- Five tries, five seconds apart (SPLINTER_RETRY_WAIT_MS still shortens
it for the tests). The wait goes through retry_sleep(), so Ctrl-C does
not have to sit it out.
- Every retry carries a correction as a user message: what was wrong,
and what to send instead. A tool result without a call before it is
refused by the endpoint, so it has to be a user turn.
- A call cut off by the token limit is a different fault from a call the
model could not write. sp_reply grew a `finish` field ("length",
"max_tokens"), filled by both the SSE parser and the non-streaming
reply; the correction then asks for a *smaller* call instead of the
same one the limit already truncated.
- After the fifth failed try the turn does not die: the model is asked
for plain words ("say what you wanted to do, step by step"), and
whatever it sends ends the turn as an answer. A call that arrives
anyway does not run and is logged whole.
- The log line keeps the whole argument string, not 240 bytes of it -
"mal gucken" means the operator can read what the model tried.
The tests were only rebuilt when their .c changed, so a new field in
struct sp_reply left them reading a different layout; that failure looks
like a broken test, not a stale object. $(TESTS) now depend on $(HDRS).
Evidence: make check exit 0 (45 binaries + 20 shell tests,
SPLINTER_RETRY_WAIT_MS=0). Counter-checks: with the old single-prompt
retry test_agent fails on bad_args_calls == 6 and on the correction
text; without the finish field cut_off_second carries "not valid JSON"
instead of "cut off by the".
The operator's claude ran into its limit mid-work; the session was too full to
continue there. The foreign plugin could already read and import it, but only
through a tool call inside a turn - there was no way in from the command line.
--claude, --opencode, --hermes and --from=NAME make the newest session that
tool ran in this directory the session of the run: it is imported before the
history is loaded, so the first turn already carries it. -c no longer fails in
a folder that has no splinter session yet; it falls back to "no session" and
lets the import decide. An empty placeholder session is removed again, whether
the import worked or not.
Repeating the call continues the same session instead of importing a second
time: sp_session_foreign() reads the foreign= marker back, so the work done in
splinter is kept. A second foreign_import into the same session replaces the
history rather than appending it twice (path_join built "id/.jsonl", so the
replace branch never fired).
Test: tests/test_foreignopen.c builds a claude fixture under its own HOME and
covers import, idempotency, replace-not-append, the empty placeholder and a
folder with no foreign session. make check exit 0, check_asan.sh clean.
A bridge that replays a non-streaming message may send one complete call per
delta and no index with it. call_slot() treated every index-less entry as the
next piece of the last call, so three finished argument objects were glued
into one string and the round died with "agent: model sent malformed tool
arguments" - the operator saw that on olivia in telegram, often.
An index-less lone entry now starts a new call when the last slot already
holds a complete argument object. Fragment-by-fragment streaming keeps its
behaviour: a partial object is not complete, so it still lands in the slot it
belongs to.
Test: tests/test_sse.c feeds exactly the three-delta shape from the logs and
expects three calls with their own arguments; without the fix it is 1 call
and the test fails. The indexed two-call case and a call split over three
deltas both still pass. make check exit 0, check_asan.sh 45/45 clean.
Automatic compaction was keyed only on stats.last_in, the prompt size the
provider reports with usage. A resumed session starts at 0, and a provider
that reports no usage leaves it at 0 - the session outgrows every endpoint's
window, the first request is refused, no usage arrives, and every later
resume fails the same way. Measured on 2026-11-22: a 9,095,724-byte session,
ctx=2,286,261 at junction, 503 no_endpoint_available on every retry.
The conversation bytes are there before anything is sent; the same four bytes
per token the target already uses are the second trigger.
tests/test_compact_resume.sh: a ~300 kB session, one turn after --resume; the
first request must be compacted. Counter-proof with the old agent.c: 302
messages, 321,087 bytes.
`--serve` holds one engine, so one client talks to it at a time - that part is
deliberate. What was not: the second client connected into the listen backlog
and then waited for a greeting that could not come until the first one left.
splinterctl printed nothing and hung; --attach gave up 10 s later with "no
greeting from the backend", which names the wrong cause.
The accept is non-blocking now and a client that arrives while the engine is
taken is answered at once: an error event with the reason, then a shutdown of
the write side. That reads on the other end as "another client is attached:
one conversation runs one turn at a time". Descriptors are drained before the
close, or the RST would eat the message the client has not read yet.
Two smaller ones on the same path:
- --attach reconnects on a broken connection; it now carries the server's error
text through instead of replacing it with "no greeting".
- a client that reads nothing is not waited for forever: a greeting timeout
turns a silent server into a message instead of a hang.
The prompt only appended: Ctrl-A, Ctrl-E, Left and Right fell through the
printable-key path and vanished, and fixing the first word of a sentence
meant retyping it. One struct editline now holds buf/cap/len/cur (bytes,
always on a UTF-8 boundary) and both prompts edit with the same keys.
Two bugs surfaced with it:
- draw_prompt_cur guarded the caret with 'caret > 0', so caret == 0 (the
start of the line) was drawn as the end of the text.
- the swarm block reset ed.cur to ed.len on every loop tick, which undid
every cursor move right after the key that made it.
The steer line of a running turn gets the same editor and a window that
follows its caret, instead of cutting the text at the right edge.
openai_stream passed the request options only when c->have_gen was set,
and only openai_server.c (splinter as a server, relaying a client's
request) ever set it. A normal turn therefore sent no
stream_options.include_usage, a provider that follows the OpenAI
contract returned no usage, reply.tokens_in stayed 0, last_in stayed 0,
and compact_threshold could never fire - a session grew monotonically to
250k tokens with the threshold at 128000.
The transport now always asks, with a local option block; the gateway
path keeps its caller's settings. Verified against a strict endpoint
that sends usage only when asked: before the fix two turns went 82->86
messages with no compaction, after it the second turn is 8 messages and
21 KB.
tests/test_usage_request.sh starts that strict endpoint (its usage is
emitted only when the request opts in) and asserts the request carries
the option and that the second turn is compacted. It fails without the
transport change.
sp_engine_input answered ui.command_busy for every command while a turn
ran, and /compact was one of them. That is the worst moment to refuse it:
a turn is what makes you look at the context size. Measured on a session
whose operator had typed /compact three times against a 253 KB request
and never saw it run - the refusal reads as "already done" and nobody
repeats the line once the turn is over.
The conversation belongs to the turn worker, so compacting inline would
race its appends. Keep the token target instead and apply it in
turn_thread after the pending model switch, before the engine goes idle;
a foreign turn (the Telegram daemon's) gets the same at
sp_engine_turn_end. The new keys ui.compact_nohost and
ui.compact_pending are in the .msg sources, which is what catalogs.c is
generated from.
tests/test_engine.c runs a real turn and types /compact while it runs;
without the turn-end call it fails at `applied`.
The host is what carries the registry to the core compactor. A plugin-less
run had none, so a conversation over max_bytes was refused instead of
compacted - the compaction that would have saved it could not be reached.
The fix landed in f712088; this is the check that keeps it.
Compaction drops most of a session out of the window, and the only way back
to it was a substring search. That answers "where does this word stand",
not "what did we say about this".
history_search is the second question: every message the session ever wrote
gets a vector, and the model asks by meaning. Three rules shaped it.
It works with no model. The default is a local encoder - the hashing trick
over words, word bigrams and character 4-grams, 256 dimensions, pure CPU -
so remembering does not stop when an API key expires. `embed = openai`
points it at a real embedding model instead. The index records which one
built it: a vector from one space compared against another is noise that
looks like a result.
It never costs the turn. Embedding runs on its own thread; the turn only
says "this session grew" (sp_embed_note_compaction, called from the
compaction event) and goes on. An index that lags is reported as lagging.
It indexes the session file, not the conversation. The conversation is what
is left after the last compaction; the file is everything that was said.
"Before compaction" is not a snapshot to take, it is the file - and the
index stores the byte offset it reached, so the update is incremental for
free. It is derived data, append-only at <session dir>/emb/<id>.emb, and
losing it costs a rebuild, never history.
/status gains a row for it (index: N messages, lags by M).
A session file was written as if it were a chat: role and text, nothing
else. Reading it back kept "user" and "assistant" and dropped everything
else - and nearly every line of an agent transcript is an observation.
Measured on three real sessions: 21 of 1507 messages came back, 8 of 1356,
3 of 317. --resume then sent 1% of the conversation and the model had no
idea what it was continuing.
Three writers had to change with the loader:
- A turn that asked for tools wrote no line at all (agent.c only wrote
when ncalls == 0). It now goes out with its tool_calls, and each result
with the name of its tool and its call id; a provider rejects a tool
message without them.
- {"role":"user","text":""} came from the steer path and showed the model
a blank human turn it answered. sp_session_append_rec writes nothing
when text and calls are both empty.
- A record from the old format has no name and no call id. It is paired
with the next unanswered call of its pending assistant turn, or given a
synthetic one (recovered-N). Dropping it is what emptied every resume;
keeping it unpaired is what a provider answers with 400.
The same pass gives the core its own compactor (compact.c): a thread digest
- one line per dropped message, OPERATOR: 800 chars, assistant: 300, tool
result 160 - so the model keeps the story, not a count. lcm stays a plugin
that runs after it; sp_core_compactor() is the fallback only when no plugin
registered one, because running both eats the conversation before lcm sees
work to do.
Two bugs fell out of the same area:
- The plugin host was only built when a plugin was configured, so a
plugin-less run had no compactor at all: over max_bytes the turn was
refused instead of compacted (90 KB session, budget 8000, "nothing
sent").
- lcm walked *forward* past tool results at the tail boundary, which
silently shrank the tail: a turn with two results kept four messages
where keep_tail says six. Walking back to the assistant that carries
the call keeps six and no orphan.
And the .meta sidecar is shared now: the core rewrote it with only the keys
it knew, so anything a plugin put there was gone on the next open. It
carries unknown lines through (extra[8][160]), which is what lets a plugin
mark a session in the core's own file.
Tests: tests/test_corecompact.c (10 checks, no plugin), the resume cases in
tests/test_session.c, and the tail-size check in tests/test_compactor.c.
Each was seen red on the old code before it was green on the new.
--interview opened the chat and then waited: the system prompt told the model
to interview the operator, but nobody sent a turn. The UI now sends the same
kickoff the Telegram daemon sends, and with piped input --interview runs that
one turn instead of waiting for a profile.
The default theme is the flat light one, and the language is English unless a
config or SPLINTER_LOCALE says otherwise - the desktop's LANG no longer
decides what the tool speaks.
junction reads an Accept naming text/event-stream as a request to stream, so
a non-streaming call got "data: {...}" back and failed with "reply is not
JSON" on models whose answer goes through its review path. Ask for a stream
only when this call is one.
Add state_dir (config/token/commands/USER.txt, default ~/.splinter) and
default session_dir to <state>/sessions. Telegram uses
<session>/telegram, so CLI and gateway sessions are separate trees.
Keep --session and the old configs working. Also carries the pending
apply_selection model-pointer fix from the n95 tree.
The daemon writes its sessions under <state>/telegram, so a CLI -c in
the same directory never picks a gateway conversation and /new in the
chat never creates a file a CLI would resume. Command scripts and
USER.txt stay in the base state dir; only the session files move.
Add --notify TEXT ("-" reads stdin) and telegram { status_chat = ID }
to send status and cron messages to the status chat. The daemon
announces its start there, and the cron bridge can use the same path.
A provider block may name the only models it offers (a bracket list in
the block syntax). sp_provider_served() then filters the endpoint's
/v1/models, so --model-list and /model's probe show only those ids.
The n95 junction provider uses it for qwen3.6-35b-checked,
qwen3.6-35b and qwen3.8-27b, not the cloud models junction also serves.
The command menu now carries /status and /menu; /model was already there. The
inline keyboard under /menu, /status, /help and /start has Status, Model, New
and Help. Status shows the TUI's facts (session, model, endpoint, agent,
tokens, steps, limits, compaction, meter); Model opens the provider picker,
which now has a Status button back. The bot menu button is forced to the
command list, so the commands show even if an older bot had another button.
The live config lists the local models (main/checked, plain, bench35, bench4b,
bench9b) so /model has more than one button; the last two need their
containers running.
tests/test_gateway.sh: /status, the /menu callback, the buttons and the
command list. tests/fake_telegram.py: the status callback and
setChatMenuButton. make check: all tests passed. check-asan: 41/41 clean.
The Telegram daemon runs in $HOME, not in a project; sp_task_scope_note would
have called the scope "home". .git in the working directory is the signal.
test_sessiontools: a plain temp directory gets no paragraph; test_engine still
sees the note in the repository root.
A session in ~/src/mikronix asked for "open tasks", called task_list without a
scope, got the makronix list and answered with it. The system prompt now names
the working directory as the default task scope (sp_task_scope_note), so the
model says "mikronix" instead of following the busiest scope. tasksd's
task_scopes/task_list descriptions now tell it to pass that scope (separate
repo, commit 4781f60).
/effort (off/low/medium/high/max or 0..12) sets X-Junction-Review-Rounds for
this process; unset keeps the router rule. The transport sends the header on
every request while set, so one session can run 0, 7 or 12 rounds without a
junction config change. /effort alone prints the current value.
test_engine: the prompt carries the scope paragraph; /effort maps to 12/2/0 and
rejects junk. make check: all tests passed. make check-asan: 41/41 clean.
A bridge that replays a completed non-streaming message in one SSE delta sends
tool_calls without an index (the non-stream shape has none). Splinter put every
index-less call of such a delta into the last slot, so junction's reviewed
answers arrived as one call whose arguments were several JSON objects:
mcp_tasksd__task_scopes with "{}{"state":"pending",...}{...}". The model was
then told its own arguments were malformed and repeated them.
Several entries in one index-less delta are now distinct calls (index = position);
a lone entry stays the next fragment of the last call, which the piecewise
streaming shape needs.
test_sse: one delta with three index-less calls yields three calls with their own
names and arguments; with the old fallback the test fails (ncalls is 1).
make check: all tests passed. make check-asan: all 41 binaries clean.
"What did we do last?" in a folder searched every session ever and wandered
off in another direction: the plugin walked the whole session directory while
only the prompt note was folder-scoped. Both tools now read the cwd from the
session's meta sidecar (sp_session_cwd, the same record the folder note uses)
and skip sessions from other folders -- and sessions that have no cwd record.
test_sessiontools creates a session in a second folder with the same needle:
with the filter disabled it shows up (red), with it the search and the list
stay in the folder, and even session=<id from elsewhere> answers "no message".
make check: all tests passed. make check-asan: all 41 test binaries clean.
session_search walks the logs of earlier sessions in this folder newest first
(query, limit, days, session) and answers with date, session id, title and a
snippet around the match; session_list shows the sessions themselves. The
running session is left out -- that is context, and lcm's recall covers what
compaction dropped -- unless a call names it with session=.
The system prompt now carries two things. When the working directory has
earlier sessions, a paragraph says how many, the newest, and that
session_search/session_list read them, so the model looks before asking the
user something that was already answered. And the default prompt tells it to
use the mcp_* tools for tasks, memory, skills and knowledge bases actively, not
only when asked.
test_sessiontools drives both tools (hit, no hit, limit, days, explicit id,
list with the current session marked); test_engine checks the prompt paragraph
and the default text. make check: all tests passed.
make check-asan: all 41 test binaries clean.
The user's ~/.splinter/splinter.conf gained "plugin session { }" (backup:
splinter.conf.bak-session).
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.
The finish path hands a strdup'd content to the reply and then allocates the
call array; if that allocation failed, the caller saw a failed reply and never
freed the content. Out of memory only, but the analyzer found it and the free
costs nothing.
test_sse, test_engine and test_agent: ok.
ASAN over the unit tests found a real leak the normal gate cannot see: a
transport failure that is not retried (the fourth 500, a 4xx, a dead stream)
returned -1 with the last reply's body and calls still allocated. The caller
only reads the reply on success, so it leaked on every terminal failure -- a
long-running daemon with a flapping provider grows by one reply per failure.
test_agent's four-500 case leaked exactly the last "boom"; it is clean now.
The same run showed the tests leaking their own fixtures: test_anthropic and
test_tasks never freed the registry they filled, test_cli forgot host4 and
host5, test_confblock forgot its error buffer, test_mcpclient its registries.
Fixed; all 39 unit binaries are now clean under ASAN+UBSAN with leak detection.
That gate is `make check-asan`: it rebuilds the tree with the sanitizers, runs
the unit binaries with LSAN, and rebuilds normally afterwards. Three MCP-plugin
teardown allocations are suppressed in tests/asan.supp: its server thread is
detached, shutdown kills the child but cannot join the thread, so the line
buffer (bounded at RPC_MAX_LINE) and the tools registered by that thread can
outlive the host. Bounded, teardown-only, tracked separately.
make check: all tests passed. make check-asan: all 39 test binaries clean.
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.
/self-check (and /selfcheck) takes the last three turns of the conversation,
every failed tool result in them and the last turn's error, and starts a turn
with them: something went wrong, check yourself instead of asking the
operator, name the cause and continue. Messages are capped per message and in
total, oldest dropped first; it is refused mid-turn like /compact and is in
the completion list.
mcp_parse() stops at the closing brace, so a tool-call argument string holding
two objects parsed as the first one and the second command disappeared without
a word -- measured in sess-1795032073, where "cat a" ran and "cat b" was
silently dropped. mcp_parse_exact() requires the whole text to be the one
value; the agent's tool-argument validation uses it, so such a reply is
retried and then fails with "model sent malformed tool arguments" instead of
running half the command.
test_engine drives both spellings and the included turn; test_agent drives the
joined-argument reply (three requests, zero tool calls). test_engine and
test_agent pass; the build is -Wall -Wextra -Werror clean.
A 4xx is the request's answer, not a transient fault, but the turn loop
printed only the number. The body is what says why (a rejected schema, a
bad tool call, a quota message), so include it in the error for 4xx.
When junction answers with Retry-After, wait at least that long instead of
our own backoff; cap it at two minutes so a hostile header cannot stall a
turn. The wire value is already parsed into reply->retry_after_s.
make check: all tests passed (clean HEAD + this change).
A model step with arguments like "{command:cd ..." is not JSON. Splinter
accepted it, ran "sh -c {command:cd ..." (exit 127), then sent the bad
assistant tool_call back on the next request: every endpoint answered 500
"Failed to parse tool call arguments as JSON" and junction cooled all four.
Arguments that start with '{' must parse now. If they do not, the reply is
freed without adding the assistant message or running a tool; the request is
retried up to three times and then fails with "model sent malformed tool
arguments". A bare string (mock/script shape) is still allowed.
test_agent drives a transport with exactly that malformed call: three requests,
zero tool calls, no "command:bad" in the conversation.
make check: all tests passed.
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.
A session started with the old picker had <session>.model = "main". The
restore accepted any selector sp_provider_choose() could not resolve and
pasted it onto the running endpoint as a model name, so the sidebar read
"junction / main" and /model showed no current row.
An unresolvable selector is now ignored and the config default / -m is used;
the session log says why. Verified with a temp session: sidecar "main" ->
-model qwen3.6-35b-judged, and the picker marks it. The real stale sidecar was
moved out of ~/.splinter.
test_engine, test_gateway, test_compactor pass; test_ui passed on rerun (its
PgDn scroll check is timing-sensitive).
A session owns the model chosen inside it, so reopening that conversation
comes back on the same model. The config is never touched: a new session
starts on core default (or -m), and the old global 90-model drop-in stays
removed. Telegram's /model remains process-only and writes no config.
- <session>.model is written by /model (provider/model, e.g.
junction/qwen3.6-35b) and read when the session is opened again.
- /new copies the model the session is on into the new session.
- test_engine checks the sidecar and that reopening restores test-model-2;
a new session still starts on config test-model.
- docs say exactly that: session choice persists, config does not.
Verified with the real config: /model junction/qwen3.6-35b writes the sidecar,
-c comes back on qwen3.6-35b, a new session starts on qwen3.6-35b-judged.
The user's rule: what the config says is the default, -m overrides it for one
run, /model overrides it for the running process - and nothing is written to
the config or to the session. The session sidecar from the previous change made
/model persistent, which is exactly the harness behaviour this rejects.
- removed <session>.model writing and restoring; a reopened session starts on
the config default or -m, not on the last /model choice.
- /new no longer copies the current model into the new session.
- Telegram's /model and probe buttons no longer write 90-model.conf; the
switch lasts for the gateway process.
- existing .model sidecars were moved out of ~/.splinter; the stale 90-model
drop-in was moved aside earlier.
- test_engine asserts that /model leaves no sidecar and that reopening uses
test-model, not test-model-2; test_gateway asserts that no 90-model.conf is
written.
- docs: "choice lasts for this run and is not saved".
Verified with the real config: default is junction/qwen3.6-35b-judged, -m
junction/qwen3.6-35b uses qwen3.6-35b for that run, /model switches to
claude-haiku for that run and the next start is judged again.
make check: all tests passed.
The picker and the text list now say what goes on the command line:
junction/qwen3.6-35b-judged, local/qwen3.6-35b. Labels and selectors are the
same string, so there is no second format to explain.
- the core endpoint (the endpoint/model without a provider block) is called
"local" in every choice; its old name "main" is still accepted as a selector
so existing drop-ins and session files keep working.
- sp_provider_choose("local/model") resolves to the core endpoint; a configured
provider with that name wins if one exists.
- /model, /model probe and the served-model list all emit provider/model.
- the session sidecar stores provider/model (junction/qwen3.6-35b).
- the sidebar and /usage print "local" for the core endpoint.
- -m provider/model no longer produces an extra main row, and 90-model.conf
(the old global /model file) was moved aside; the config's provider wins.
- tests and docs use local/test-model and local/m.
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.
The chat named the window and pane "S: <dir>" at startup but left it there
when it exited, so the shell prompt inherited the label of a program that was
gone. tmux_title now captures the previous window name, pane title and
automatic-rename value before it renames anything, and tmux_title_reset puts
them back:
- registered with atexit for the normal quit and the double-Ctrl-C exit,
- called from a SIGTERM/SIGHUP/SIGQUIT handler after endwin(), so a killed
chat does not leave the terminal or the title behind (SIGINT stays the
chat's own cancel key).
The commands still go through execvp, never a shell; the captured names are
argv entries. Manual check: "S: work" -> Ctrl-D -> the previous "OLD"/
"OLD_PANE" are back. README says so.
make check: all tests passed.
`make check` created a session for every splinter invocation that did not set
HOME - the A2A and gateway scripts pass --no-config, which does not change the
session directory. The user's ~/.splinter collected hundreds of "hallo",
"fehler" and "auth ohne token" sessions; the last three in /sessions were test
noise that looked like aborted chats.
- SPLINTER_SESSION_DIR overrides the session directory (o->session_dir still
wins when a caller names one, so test_engine keeps its temp dir).
- make check exports a mktemp session dir and removes it on exit; the scripts
that inspect $D/home/.splinter point the variable there.
- docs/CONFIG documents the variable.
- the existing test sessions were moved to
~/.splinter/test-sessions-2026-11-18 (not deleted) so /sessions shows the
real conversations again.
make check: all tests passed; ~/.splinter kept 211 sessions before and after.
A judged request sends the whole tool list to the judge. Claude validates the
schemas and rejected the request with 400
"tools.22.function.parameters.type: Field required": delegate_due and
delegate_jobs declared "parameters": {} instead of an object schema. junction
wrapped that 400 in the stream as data: {"error":{...,"code":400}}, but the SSE
parser ignored anything that was not a choice - so the turn ended with
"stream ended with no answer" and the one line explaining it was lost. Three
sessions stopped that way at the same minute.
- delegate_due/delegate_jobs now carry {"type":"object","properties":{}}.
- test_engine walks every registered tool and fails when parameters.type is
not "object"; this catches the next schema before a judge does.
- sp_sse_line recognises a top-level error object, reports its message and
remembers its code; the transport puts the code in the reply status.
- a 4xx from the stream ends the turn with the real message and is not
retried; an empty 2xx stream and a 5xx still are. 402/429/529 stay with the
usage-limit path, which already handles them.
- test_sse feeds the junction 400 event and checks message and code.
- README and docs/PLUGINS say why a tool schema needs type:object.
make check: all tests passed.
The status table was sized by MAX_COMPACTORS (8). With the status plugin's
seven segments and lcm's new "compact" segment, junction's segment was the
ninth: sp_host_add_status failed, junction_init returned -1 and the whole
plugin was skipped. The user saw no junction widget and no junction tool.
Status segments now have MAX_STATUS (16) slots of their own, and
test_compactor registers nine extra segments so the shared cap cannot come
back.
The curses chat also asks tmux, when TMUX and TMUX_PANE are set, to name the
window and pane after the directory it was started in: "S: <dir>", with
automatic-rename off for that window. tmux is exec'd directly, never through a
shell, and nothing is written into the curses screen. test_ui checks both
names.
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 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.