anthropic-usage-base-urls
29
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
05c8d936e7 |
anthropic transport, provider usage APIs, endpoints as /v1 base
- 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> |
||
|
|
2e7a88c462 |
usable: opencode-go session header, embedded catalogs, locale fixes, calmer UI, --doctor
- 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> |
||
|
|
b8db78816a |
agent profiles: Tab switches build/plan/yours; files in ~/.splinter/agents, .agents/
build (all tools) and plan (read-only plus delegate/plan_task) are built in; a markdown file with opencode-style front matter (description, model, tools, allow, deny, autonomous) adds or replaces one. Tool policy is enforced in the agent loop, the prompt is added to the system message, /agent and --agent. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
0b7a91e3b7 |
config blocks, pools, -m/--model-list, waiting out usage limits
Config: { } blocks (core, telegram, provider, pool, exit) translated to the flat
reader with source line numbers; flat form still loads; delegate/plugin limits
raised. Pools: failover/balance, used by delegation (tag-safe), by -m and for
the conversation when its provider hits a limit. -m SEL picks a pool, provider,
provider/model or model name; --model-list lists them with served models.
Usage limits: the agent finds the reset and waits (UI: Ctrl-C stops, /resume
goes on; on_limit=fail turns it off).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
||
|
|
5de70f5dbb |
gateway, ui: /new starts a fresh conversation; /connect in the TUI
/new (and /reset) opens a new session file in the same directory, drops the conversation back to the system prompt and, in the gateway, resets the interview/connect state so a half-finished flow does not survive the reset. The old session file stays: it is the record of what was said. In the TUI the history pane is cleared, because it shows the old conversation. The directory is read before the static session struct is cleared, or the second /new would start from an empty path. /connect exists in the TUI now: the same four questions, one answer per line, the same validation and presets, and connect.nodir when the run has no config file to write to (--no-config). conv.c grows sp_conv_reset(), which frees every message and puts the system prompt back. test_gateway checks /new (message and a new session file); test_ui checks /new in the pane and the /connect guard with --no-config. |
||
|
|
7ce8e6b96c |
gateway: /model switches models, /connect adds a provider
/model offers the models the configuration names -- the main endpoint, every delegate with a model, every exit -- as inline buttons and points the agent's transport at the one that is pressed. /model <name> keeps the endpoint and takes another model from it. A provider whose key variable is not exported is marked in the menu. The choice is not written: it lasts for the session, a restart goes back to the config. /connect asks for name, endpoint, model and key variable, validates each answer, and writes the delegate line to <config>.d/20-connect.conf before anything is used, so the same run has the provider and the next start loads it. and [?2031h]10;?]11;?[>0q[?25l[s[6nP+q4d73\[?1016$p[?2027$p[?2031$p[?1004$p[?2004$p[?2026$p[?u]99;i=opentui-notifications:p=?;\]1337;Capabilities\]7501;?\[H]66;w=1; \[6n[H]66;s=2; \[6n[u[s[?1049h[?25l[>4;1m[?2004h[?1000h[?1002h[?1003h[?1006h[14t]7501;state=idle:app=opencode\[?2026h[?25l[1;1H[38;2;255;255;255m[48;2;17;28;24m [2;1H[38;2;255;255;255m[48;2;17;28;24m [3;1H[38;2;255;255;255m[48;2;17;28;24m [4;1H[38;2;255;255;255m[48;2;17;28;24m [5;1H[38;2;255;255;255m[48;2;17;28;24m [6;1H[38;2;255;255;255m[48;2;17;28;24m [7;1H[38;2;255;255;255m[48;2;17;28;24m [8;1H[38;2;255;255;255m[48;2;17;28;24m [9;1H[38;2;255;255;255m[48;2;17;28;24m [10;1H[38;2;255;255;255m[48;2;17;28;24m [11;1H[38;2;255;255;255m[48;2;17;28;24m [12;1H[38;2;255;255;255m[48;2;17;28;24m [13;1H[38;2;255;255;255m[48;2;17;28;24m [14;1H[38;2;255;255;255m[48;2;17;28;24m [15;1H[38;2;255;255;255m[48;2;17;28;24m [16;1H[38;2;255;255;255m[48;2;17;28;24m [17;1H[38;2;255;255;255m[48;2;17;28;24m [18;1H[38;2;255;255;255m[48;2;17;28;24m [19;1H[38;2;255;255;255m[48;2;17;28;24m [20;1H[38;2;255;255;255m[48;2;17;28;24m [21;1H[38;2;255;255;255m[48;2;17;28;24m [22;1H[38;2;255;255;255m[48;2;17;28;24m [23;1H[38;2;255;255;255m[48;2;17;28;24m [24;1H[38;2;255;255;255m[48;2;17;28;24m [0m]22;default\[?2026l]0;OpenCode[?2026h[?25l[7;22H[38;2;83;104;91m[48;2;17;28;24m [0m[7;42H[38;2;193;196;151m[48;2;17;28;24m[1m ▄[7;56H [0m[8;22H[38;2;83;104;91m[48;2;17;28;24m█[8;23H▀[8;24H▀[8;25H█[8;26H █[8;28H▀[8;29H▀[8;30H█[8;31H █[8;33H▀[8;34H▀[8;35H█[8;36H █[8;38H▀[8;39H▀[8;40H▄[8;41H[0m[8;42H[38;2;193;196;151m[48;2;17;28;24m[1m█[8;43H▀[8;44H▀[8;45H▀[8;46H █[8;48H▀[8;49H▀[8;50H█[8;51H █[8;53H▀[8;54H▀[8;55H█[8;56H █[8;58H▀[8;59H▀[8;60H█[8;61H[0m[9;22H[38;2;83;104;91m[48;2;17;28;24m█[9;23H[0m[9;23H[38;2;83;104;91m[48;2;34;47;41m [0m[9;25H[38;2;83;104;91m[48;2;17;28;24m█[9;26H █[9;28H[0m[9;28H[38;2;83;104;91m[48;2;34;47;41m [0m[9;30H[38;2;83;104;91m[48;2;17;28;24m█[9;31H █[9;33H[0m[9;33H[38;2;83;104;91m[48;2;34;47;41m▀[9;34H▀[9;35H▀[9;36H[0m[9;36H[38;2;83;104;91m[48;2;17;28;24m █[9;38H[0m[9;38H[38;2;83;104;91m[48;2;34;47;41m [0m[9;40H[38;2;83;104;91m[48;2;17;28;24m█[9;41H[0m[9;42H[38;2;193;196;151m[48;2;17;28;24m[1m█[9;43H[0m[9;43H[38;2;193;196;151m[48;2;61;70;56m[1m [0m[9;46H[38;2;193;196;151m[48;2;17;28;24m[1m █[9;48H[0m[9;48H[38;2;193;196;151m[48;2;61;70;56m[1m [0m[9;50H[38;2;193;196;151m[48;2;17;28;24m[1m█[9;51H █[9;53H[0m[9;53H[38;2;193;196;151m[48;2;61;70;56m[1m [0m[9;55H[38;2;193;196;151m[48;2;17;28;24m[1m█[9;56H █[9;58H[0m[9;58H[38;2;193;196;151m[48;2;61;70;56m[1m▀[9;59H▀[9;60H▀[9;61H[0m[10;22H[38;2;83;104;91m[48;2;17;28;24m▀[10;23H▀[10;24H▀[10;25H▀[10;26H █[10;28H▀[10;29H▀[10;30H▀[10;31H ▀[10;33H▀[10;34H▀[10;35H▀[10;36H ▀[10;38H[0m[10;38H[38;2;34;47;41m[48;2;17;28;24m▀[10;39H▀[10;40H[0m[10;40H[38;2;83;104;91m[48;2;17;28;24m▀[10;41H[0m[10;42H[38;2;193;196;151m[48;2;17;28;24m[1m▀[10;43H▀[10;44H▀[10;45H▀[10;46H ▀[10;48H▀[10;49H▀[10;50H▀[10;51H ▀[10;53H▀[10;54H▀[10;55H▀[10;56H ▀[10;58H▀[10;59H▀[10;60H▀[10;61H[0m[13;4H[38;2;61;74;68m[48;2;17;28;24m┃[0m[13;5H[38;2;255;255;255m[48;2;35;55;43m [0m[14;4H[38;2;61;74;68m[48;2;17;28;24m┃[0m[14;5H[38;2;255;255;255m[48;2;35;55;43m [0m[14;7H[38;2;83;104;91m[48;2;35;55;43mAsk anything…[14;20H "What is the tech stack of this project?"[0m[14;62H[38;2;255;255;255m[48;2;35;55;43m [0m[15;4H[38;2;61;74;68m[48;2;17;28;24m┃[0m[15;5H[38;2;255;255;255m[48;2;35;55;43m [0m[16;4H[38;2;61;74;68m[48;2;17;28;24m┃[0m[16;5H[38;2;255;255;255m[48;2;35;55;43m [0m[17;4H[38;2;61;74;68m[48;2;17;28;24m╹[0m[17;5H[38;2;35;55;43m[48;2;17;28;24m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀[0m[18;4H[38;2;83;104;91m[48;2;17;28;24m~/src/splinter:main[0m[18;46H[38;2;193;196;151m[48;2;17;28;24mshift+tab [0m[18;56H[38;2;83;104;91m[48;2;17;28;24magents[0m[18;64H[38;2;193;196;151m[48;2;17;28;24mctrl+p [0m[18;71H[38;2;83;104;91m[48;2;17;28;24mcommands[0m[23;74H[38;2;83;104;91m[48;2;17;28;24m2.2.6[0m[0m]12;#c1c497[1 q[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;67;74;68m[48;2;17;28;24m┃[0m[14;4H[38;2;67;74;68m[48;2;17;28;24m┃[0m[15;4H[38;2;67;74;68m[48;2;17;28;24m┃[0m[16;4H[38;2;67;74;68m[48;2;17;28;24m┃[0m[16;7H[38;2;41;56;44m[48;2;35;55;43mBuild[0m[16;13H[38;2;36;56;44m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;39;59;46m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;36;56;44m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;67;74;68m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;82;75;68m[48;2;17;28;24m┃[0m[14;4H[38;2;82;75;68m[48;2;17;28;24m┃[0m[15;4H[38;2;82;75;68m[48;2;17;28;24m┃[0m[16;4H[38;2;82;75;68m[48;2;17;28;24m┃[0m[16;7H[38;2;58;58;46m[48;2;35;55;43mBuild[0m[16;13H[38;2;40;60;48m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;52;70;54m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;40;60;48m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;82;75;68m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;104;76;68m[48;2;17;28;24m┃[0m[14;4H[38;2;104;76;68m[48;2;17;28;24m┃[0m[15;4H[38;2;104;76;68m[48;2;17;28;24m┃[0m[16;4H[38;2;104;76;68m[48;2;17;28;24m┃[0m[16;7H[38;2;83;61;49m[48;2;35;55;43mBuild[0m[16;13H[38;2;46;66;54m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;70;86;67m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;46;66;54m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;104;76;68m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;130;77;68m[48;2;17;28;24m┃[0m[14;4H[38;2;130;77;68m[48;2;17;28;24m┃[0m[15;4H[38;2;130;77;68m[48;2;17;28;24m┃[0m[16;4H[38;2;130;77;68m[48;2;17;28;24m┃[0m[16;7H[38;2;114;65;52m[48;2;35;55;43mBuild[0m[16;13H[38;2;52;72;60m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;91;105;82m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;52;72;60m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;130;77;68m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;159;79;69m[48;2;17;28;24m┃[0m[14;4H[38;2;159;79;69m[48;2;17;28;24m┃[0m[15;4H[38;2;159;79;69m[48;2;17;28;24m┃[0m[16;4H[38;2;159;79;69m[48;2;17;28;24m┃[0m[16;7H[38;2;146;69;56m[48;2;35;55;43mBuild[0m[16;13H[38;2;59;80;67m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;115;126;98m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;59;80;67m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;159;79;69m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;199;80;69m[48;2;17;28;24m┃[0m[14;4H[38;2;199;80;69m[48;2;17;28;24m┃[0m[15;4H[38;2;199;80;69m[48;2;17;28;24m┃[0m[16;4H[38;2;199;80;69m[48;2;17;28;24m┃[0m[16;7H[38;2;191;75;61m[48;2;35;55;43mBuild[0m[16;13H[38;2;69;90;77m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;147;155;120m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;69;90;77m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;199;80;69m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;224;82;69m[48;2;17;28;24m┃[0m[14;4H[38;2;224;82;69m[48;2;17;28;24m┃[0m[15;4H[38;2;224;82;69m[48;2;17;28;24m┃[0m[16;4H[38;2;224;82;69m[48;2;17;28;24m┃[0m[16;7H[38;2;220;78;65m[48;2;35;55;43mBuild[0m[16;13H[38;2;75;96;83m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;168;173;134m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;75;96;83m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;224;82;69m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;243;82;69m[48;2;17;28;24m┃[0m[14;4H[38;2;243;82;69m[48;2;17;28;24m┃[0m[15;4H[38;2;243;82;69m[48;2;17;28;24m┃[0m[16;4H[38;2;243;82;69m[48;2;17;28;24m┃[0m[16;7H[38;2;241;81;67m[48;2;35;55;43mBuild[0m[16;13H[38;2;80;101;88m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;183;187;144m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;80;101;88m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;243;82;69m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;254;83;69m[48;2;17;28;24m┃[0m[14;4H[38;2;254;83;69m[48;2;17;28;24m┃[0m[15;4H[38;2;254;83;69m[48;2;17;28;24m┃[0m[16;4H[38;2;254;83;69m[48;2;17;28;24m┃[0m[16;7H[38;2;254;83;69m[48;2;35;55;43mBuild[0m[16;13H[38;2;83;104;91m[48;2;35;55;43m·[16;14H[0m[16;15H[38;2;192;195;151m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[16;40H[38;2;83;104;91m[48;2;35;55;43mOllama Cloud[0m[17;4H[38;2;254;83;69m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l[?2026h[?25l[13;4H[38;2;255;83;69m[48;2;17;28;24m┃[0m[14;4H[38;2;255;83;69m[48;2;17;28;24m┃[0m[15;4H[38;2;255;83;69m[48;2;17;28;24m┃[0m[16;4H[38;2;255;83;69m[48;2;17;28;24m┃[0m[16;7H[38;2;255;83;69m[48;2;35;55;43mBuild[0m[16;15H[38;2;193;196;151m[48;2;35;55;43mDeepSeek V4.1 Flash 1017[0m[17;4H[38;2;255;83;69m[48;2;17;28;24m╹[0m[0m[14;7H[?25h[?2026l]7501;state=clear\[?25h[0m]22;\[>4;0m[?1003l[?1002l[?1000l[?1006l[?2004l[?1049l[?2031l]0;]12;default]112[0 q[?25h[?25h stand for their usual endpoints. The drop-in goes next to the file that was actually read (sp_config_loaded_path), not next to a path guessed from the environment, so --config works. providers.c holds the list, the validation, the transport switch and the provider identity main.c used to compute inline. test_providers covers the list, the refusals, replacement of a line and a reload of what was written; test_gateway presses the model button, proves the next turn goes to the new endpoint (the test one is dead) and runs /connect to the written file. |
||
|
|
a00ffef699 |
a2a: INPUT_REQUIRED -- a turn that pauses and resumes
sp_agent_run can stop before a mutating tool when an approval callback returns 2; the assistant call is in the conversation, no observation is. sp_agent_resume(decision) runs the pending calls, adds the observations and continues the model loop. Normal callers are unchanged: the ack, UI and gateway paths still return 0/1. The A2A server pauses as TASK_STATE_INPUT_REQUIRED, keeps the task and its context, and resumes on SendMessage with the same taskId and yes/no. CancelTask cancels a paused task. SendStreamingMessage has no resume point and denies mutating tools instead. test_pause covers allow/deny in the agent; test_a2a_input covers the whole HTTP flow (yes, no, cancel). Full make check green (33 C tests). |
||
|
|
808039cd58 |
cli: the main transport falls back at the limit, too
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> |
||
|
|
75d8beeaa4 |
delegates and cli_env: hardcoded environment per cli program; swarm, provider, planner, scheduler, tmux
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> |
||
|
|
25a616a87f |
review fixes, third round: the gateway asks in its chat, approvals say what
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> |
||
|
|
6fe30f4787 |
security: the authorization model holds where the model writes the input
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>
|
||
|
|
3c5cdaf53a |
splinter: delegations are tasks too, and the status line is alive
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. |
||
|
|
41662a7293 |
splinter: delegates on other hosts, and the first-run interview
A delegate may name a host; the whole invocation then goes through ssh, so claude, opencode or another splinter run on that machine. delegate and delegate_parallel both honour it, and the report names the host like any other model. The environment does not cross the jump: a cli delegate carries its command explicitly (quoted, because ssh rejoins its arguments into one remote shell command), and the remote host supplies its own keys. Proven: a delegate with host=172.25.206.16 ran on olivia and answered through a provider only reachable over the wireguard link. --interview asks seven questions once - language, who you are, stack, style, what never to do, sacred paths - and writes ~/.splinter/profile/<user>.md. Enter skips a question and the skip is recorded as a skip. Starting the chat without a profile prints a hint. Two bugs found while testing: the stdin intake ate the interview's answers before it could ask, and the question texts carried literal \n because of how the file was written - both fixed and verified by running the interview with piped answers and reading the resulting profile. |
||
|
|
e4f25b481f |
splinter: sessions belong to a directory, and splinter as an MCP server
Every session records the directory it was started in (<id>.meta, cwd=). With that, '-c' means the last session that happened *here*: cd ~/src/splinter && splinter -c A session from another tree is never silently loaded; if nothing happened in this directory yet, it says so and exits. Verified in three directories - two report no session, the one with history resumes. folder_history gives the model the folder's memory instead of a guess: sessions started there, newest first, with turn count and the last question. --mcp-server-listen IP --mcp-listen-port N serves the registry over MCP (newline-delimited JSON-RPC on TCP): initialize, tools/list, tools/call. Read tools are served; mutating and destructive ones are refused unless the server was started with --autonomous - a remote agent does not run shell commands here because it asked nicely. Proven with a real client on 127.0.0.1:8097: handshake answers splinter 0.1.0, tools/list reports 14 tools, tools/call list returns the directory, tools/call run is refused with the authorization message. |
||
|
|
d8c94edb55 |
splinter: providers from the environment, prio and max_parallel
OLLAMA_KEY, OLLAMA_KEY_0.._N and CLAUDE_CODE_OAUTH_TOKEN, _0.._N are enough to fill the harness: every Ollama key becomes a delegate and an exit in the ring, every Claude token becomes a cli delegate running 'claude -p'. Several keys mean several accounts; the ring walks them. That is the workflow the tool exists for - a strong model plans and defines the work, the local models implement it, delegate is the handover: OLLAMA_KEY=... CLAUDE_CODE_OAUTH_TOKEN=... splinter --choose 'plane die arbeit' claude-3 score=4 prio=10 task mentions 'plan' OLLAMA_KEY=... splinter --choose 'implementier das' ollama-2 score=3 prio=0 task mentions 'implement' Delegates also take prio (tie-break, higher wins) and max_parallel (default 1, a busy delegate says so instead of queueing silently). kind=cli with cmd=... runs a program instead of an endpoint. Keys travel in the environment, never on a command line or into a log. test_config covers the scan, test_delegate the prio tie-break. |
||
|
|
a720b67cb0 |
splinter: session logs, slash programs, telegram typing
Logs: every session keeps ~/.splinter/logs/<id>/session.log (readable, in order, nothing truncated) and wire.jsonl (request bodies and replies). The agent records the user's words, the answer, the reasoning, every tool call with arguments, every observation, failures, and the transport records the wire. Slash programs: anything executable in ~/.splinter/commands/ becomes /name. It gets the rest of the line as one argument and its output goes to the *model* as context, not to the operator as a reply. Two bugs found by trying it: the directory was derived from --session (so a session elsewhere found nothing), and the whole slash branch only ran when a plugin host existed, so without plugins /uptime was never even looked at. Telegram: a typing thread sends sendChatAction every four seconds while a turn runs - and only while a turn runs, not while a plugin answers a slash command. The gateway no longer appends to the session twice (the agent already does). docs/ROADMAP.md lists what is still open, in the order it should be done. |
||
|
|
3ae2b8f74d |
splinter: gateway mode, answers on Telegram
--daemon long-polls getUpdates, runs one turn per message and replies. The token comes from ~/.splinter/telegram.token (0600) or SPLINTER_TELEGRAM_TOKEN, never from an argument: arguments end up in ps and in shell history. telegram_allow lists who is answered, comma separated, nobody by default - an empty list is a refusal, not an open door. Unknown senders are logged without their text. The loop survives a failed request instead of dying on it, and keeps no state beyond the session: a restart re-delivers the last update, which costs one duplicated answer and never a lost message. test_telegram covers the token paths (file wins, environment as fallback, empty file is not a token). Verified against api.telegram.org: the token works and getMe answers hbx_splinter_bot. Sending needs the user to write first - a bot cannot start a chat, the API says 'chat not found'. |
||
|
|
781e7eb514 |
splinter: delegation to configured models, chosen by splinter
A delegate is a line in the config - id, what it is good at, tags, endpoint, model. No profiles: a profile is a directory of files, and this needs a line you can read at 2 a.m. The delegate tool takes a task and optional tags. The pick is code, not a guess: requested tag 5, tag in the task 3, description word 1, ties to the earlier entry. The observation opens with the choice and the reason, and --choose prints the same decision without running anything: coder 7 task mentions 'code' quick 5 task mentions 'chat' coder 3 task mentions 'refactor' The child is splinter itself in one-shot mode - same tools, own context, own endpoint and model. Classed destructive, because it runs a whole agent; the operator approves the delegation once. test_delegate pins the decisions, including the two cases that must not pick anything: no matching tag and no delegates at all. |
||
|
|
e128d679e4 |
splinter: write and edit show a diff
A mutate tool that says 'wrote 23 bytes' tells the operator nothing. write and edit now put a one-hunk diff into the observation - common prefix and suffix as context - so the model sees what it did and the transcript shows it as its own 'anderung:' entry. One hunk, not a general diff algorithm: a tool changes one place, and the point is to see which. Verified against kontron: asking for an edit produced @@ -1,2 +1,2 @@ zeile eins -zeile zwei +zeile zwei geaendert and the file on disk really was changed. |
||
|
|
be947d61d8 |
splinter: resume, and an MCP client
--resume loads the newest session in the directory into the conversation and shows it. The first version opened a fresh id beside the old one and resumed nothing while claiming to; it now picks the newest sess-*.jsonl before the id is generated. Verified: a session that was told 'die Zahl ist 4711' and restarted with --resume answered '4711' when asked. plugins/mcp speaks MCP over stdio: handshake, tools/list, and each server tool registered under its published inputSchema - not an empty object, because a tool whose parameters the model cannot see gets called with nothing. Two bugs the tests would not have caught without a real server: * the reply id was matched with strstr(), and servers that write "id": 1 lost the match - the client waited for a reply it already had; * tool descriptions pointed into the parsed reply and dangled once it was freed, so the request carried garbage bytes and the endpoint answered 500. Also SPLINTER_DUMP_REQUEST=<path> now keeps the request body; finding that garbage meant seeing what was actually sent. |
||
|
|
c8b382c84e |
splinter: file tools, and approval asked on the screen
The harness had echo, run and clock - a chat with a shell. A coding agent needs
to look at a file, change one, find something, list a directory:
read (read) numbered lines, offset/limit, refuses binary, says where it
stopped
search (read) literal search over a tree, capped at 100 hits
list (read) a directory
write (mutate) up to 4 MiB
edit (mutate) exactly one occurrence; a non-unique 'old' is an error
run (destructive, already there)
Approval was dead code in the chat: ask_operator() read stdin, which a curses
program cannot do without eating its own keystrokes, so with --autonomous off
every mutate tool was silently denied ('fail closed'). The agent now asks through
a callback; the UI puts the question in the prompt line and parks the turn
thread on a condition variable until y or n arrives.
Measured against kontron: prompt appeared 6 s into the turn, 'y' ran the tool and
the answer carried its output; 'n' left the target file absent and the model saw
'error: denied by operator'.
test_builtin covers the refusals, not just the happy path: ambiguous edit writes
nothing, binary read reports instead of spraying, missing arguments say what is
required. README no longer claims there is no tool-call parser and no compaction.
|
||
|
|
fd72b688c1 |
splinter: Ctrl-C actually cancels, and no fixed /tmp
Pressing Ctrl-C killed the harness. cbreak() leaves ISIG on, so the terminal driver turned the key into SIGINT and the process died before wgetch() could return 3 - the 'Ctrl-C cancels' line was a claim, and one keystroke disproved it. raw() hands every byte to the program. Cancelling a turn also only took effect between steps, so a request in flight kept running to completion. The transport used popen(), which returns a stream and not a process id, so there was nothing to kill. It now forks and execs, keeps the pid, and both the read loop and the streaming loop poll with a 200 ms timeout and SIGKILL the child when the turn is cancelled. Measured: Ctrl-C during a streaming request returns to the prompt in 510 ms and the UI survives. Temp files no longer use a fixed /tmp path: $TMPDIR, then /var/tmp. Three sites, including the cli plugin, and they carry the conversation, so the path is now a 512-byte buffer built at runtime instead of a literal. |
||
|
|
554b4c97b8 |
splinter: tool calls with arguments, newline-aware rows, complete i18n
Four things, three of them reported by the operator.
1. Rows are counted from the real line structure. The old arithmetic
(strlen/cols) assumed one long line; a model's reasoning is full of '\n', so
the true height was far larger than the estimate and the text painted over
the answer below it - 'it just goes anywhere on the screen'. text_rows() and
row_offset() split on newlines first, then wrap. entry_lines() now measures
the string that is actually drawn ('role: text'), which also fixes the last
character of an entry being cut off (a truncated code fence).
2. Tool calls are visible: the agent's tool_begin hook fires before each call,
the UI drains the list under its lock and writes 'werkzeug: run
{"command":"echo a"}' into the transcript; the one at the top of the live
area shows the call while it runs. The reasoning entry is inserted before
those lines, so the transcript reads du, denkt, werkzeug, modell.
3. The chat pane has a black background, and the status line sits between the
pane and the prompt, the way Hermes shows it.
4. i18n is complete: every remaining literal in ui.c, main.c and the plugins
goes through the catalogue, including widget texts and format strings.
sp_td() carries a compiled-in English default, so a missing catalogue can
never drop a printf placeholder. tools/check_i18n.py runs in make check and
fails when a key used in the code is missing from any catalogue, or when a
catalogue key is used nowhere.
Seventeen test binaries green.
|
||
|
|
95a57fdbbc |
splinter: exact token counts from the provider's usage block
The sidebar counted characters and guessed tokens. The provider reports the real numbers in the final chunk (prompt_tokens/completion_tokens, or input_tokens/output_tokens), so both the streaming accumulator and the one-shot reply parser now keep them, the agent sums them per turn, and the sidebar shows '79 tok (in 344)' instead of an estimate. The estimate stays as the fallback for endpoints that report nothing, and it is still labelled as one. |
||
|
|
5c07b32478 |
splinter: streaming, thinking, and three defects the real model exposed
Streaming: the OpenAI transport reads SSE over curl -N and reports deltas as they arrive. Text goes to the chat pane, a tool-call start to the sidebar, and a reasoning model's reasoning_content is shown dimmed above the answer instead of being hidden - which is what made a 143 s turn look like a dead terminal. Measured against kontron (Qwen3.6-35B, strata-poly): first byte at 11.6 s on a short question, text growing visibly in the TUI at 7 s and 17 s on a longer one. test_sse drives the accumulator with recorded lines: plain text, a tool call split over three chunks, two calls in one turn, a broken data line, keepalives. Twelve test binaries green. Defects found while proving it, each fixed or stated: - typed umlauts were dropped: the input loop accepted ASCII only. Every byte above 0x1f is kept now and the line is redrawn from the buffer. - setlocale() was never called, so curses had no encoding at all. - the vendored NetBSD curses emits Latin-1 bytes for wide characters (ü -> 0xFC) while ncurses passes UTF-8 through; proven with a raw pty dump of both. The UI therefore transliterates for display (gruen) and the conversation and session log keep the exact UTF-8. The library defect is written down, not papered over. - an answer longer than the screen was skipped by the viewport and the chat looked empty; draw_history now shows the bottom of the content, including entries taller than the window. |
||
|
|
50bc6751b2 |
splinter: real-model fixes, steering, cli transport
First run against a real model (Qwen3.6-35B-A3B on kontron, strata-poly)
exposed two things a stub never would:
- our tool schema sent "properties":{}, which tells the model that no
arguments exist. Tools now carry a real JSON schema (echo/command/clock), and
the loop completes a tool round against the 35B: request 1 -> tool_call,
request 2 -> "Das Ergebnis ist: ping".
- an answer longer than the screen was not drawn at all: the entry did not
'fit', so the viewport skipped it and the chat looked empty. draw_history is
now a real viewport (total height, bottom-anchored, entries taller than the
screen start at the offset that puts their end on screen).
Steering: a turn runs on its own thread while the UI keeps reading keys. Enter
queues text the loop picks up at the next step boundary; Ctrl-C cancels; in a
single-step turn the text becomes the next message instead of disappearing.
Curses remains UI-thread-only. A dangling ag->cfg after the turn made a steer
run twice - the caller's config is now restored, and the session log confirms
one user line per steer.
Transports are plugins now (sp_host_add_transport / --transport). plugins/cli
makes any program the model: SPLINTER_CLI_CMD, run through /bin/sh, prompt on
stdin, stdout as the answer, 4 MiB cap, non-zero exit with the program's stderr,
empty output is an error. Verified with sed, with claude -p (2.9 s, answer OK)
and with cat.
Eleven test binaries green, test_cli included.
|
||
|
|
b8295ea474 |
splinter: compaction as plugins (lcm, cps)
Compaction is not a flag in the loop; it is a compactor registered by a plugin and run on the main thread before every request, with the whole conversation in hand. Returning 1 means changed, 0 nothing to do, -1 failed - and a failure is counted, not fatal. lcm: deterministic lossy compression. Over budget, it keeps the leading system prompt and the last six messages and inserts one system message that says how many messages went, of which roles, and quotes the head of the oldest dropped turn. No second model, so a run stays reproducible and costs nothing extra. cps: continuous parallel compression. The worker thread decides what would go from an index it got under a mutex (role, size, 64 bytes of head per message) and never touches the conversation; the main thread splices the prepared plan in one pass when the budget is hit. The sidebar line shows applied/prepared counts or a ready plan, so the claim is visible. The limit is in both files: they can decide which messages go, not summarise their text, because the text is not the worker's to read. Ten test binaries green; test_compactor drives both against their real .so files, including that lcm leaves the system prompt first, inserts the [lcm] record at index 1, keeps the tail verbatim, and that cps needs two calls (prepare, then apply) to change anything. |
||
|
|
15581139d5 |
splinter: conversation, OpenAI adapter, end-to-end over HTTP
Splinter can now talk to a real endpoint: --endpoint plus --model shapes the whole conversation into one chat/completions request and parses the reply back. The seam changed from a raw string to the conversation, because a provider adapter cannot invent history and the loop must not depend on vendor JSON: - sp_conv: owned messages (role, name, call_id, content, raw tool_calls), geometric growth, trim from the front. Copy on push, so a compaction step must produce a new array - which is what makes it reviewable. - sp_openai_request(): conversation + tool table -> JSON body. - sp_openai_reply(): choices[0].message -> content + calls, and it keeps the provider's raw tool_calls array to hand back verbatim next round. - provider error objects, empty choice lists, non-JSON bodies and empty bodies each produce a distinct, quoted error instead of a silent empty answer. - transport_openai: curl, body through a temp file, status from curl's -w, key from the environment only. - libmcp's JSON parser is vendored and instantiated exactly once (src/json.c); two instantiations would be a link error rather than a silent duplicate. Proven end to end against a local stub speaking the real wire format: request 1 (1 message, 2 tools, 448 bytes) -> tool_call for echo; splinter ran the tool, request 2 (3 messages, 682 bytes) -> final text; the session log holds user, observation, assistant. Nine test binaries green, including test_openai (request shape, tool_call parsing, raw array kept, four failing reply shapes) and test_conv. |
||
|
|
10e59f23ac |
splinter 0.1.0: loop, registry, session, transports, tests
Rebuilt from scratch after the previous attempt left no code behind: what exists here is what compiles and what the tests prove, and nothing else is claimed. What is in it: - a turn loop that refuses an over-budget request before sending it, reports unknown tools instead of guessing, and honours authorization classes (read runs, mutate/destructive ask unless --autonomous); - a registry that is authoritative - the model names a tool, the registry decides whether it exists; - an append-only JSONL session (O_APPEND, fsync per record), where a crash can only truncate the tail and the tail is skipped, not repaired; - two transports: a deterministic mock (queue of replies, last request kept) and HTTP via curl(1) with the request body in a temp file; - two builtins that exist to prove the classes: echo (read) and run (destructive, reports its exit status as an observation). Five test binaries, no external framework, no network: mock driver covers the answer path, a tool round, an unknown tool, a denial, autonomy, a failing tool, the step limit, the byte budget (asserting that nothing was sent) and a non-2xx reply. The wire format is splinter's own line protocol (user/observe out, answer/tool in); provider adapters translate. That is why the loop is testable without a model, and why no vendor JSON is parsed in the core. |