50 ancestors of 88cfdf0095edd843
|
2026-11-19
| ||
| 17:33 |
Bash output that does not fit goes to the journal, not a temp file (ticket 75eb601110)
When a command's output is cut to Pi's last 2000 lines or 50 KB, the full output (its last 16 MB) is now stored with the call in the journal as pic_output, compressed by the SQLite Archive rule, in the same transaction as the result. The supervisor streams it to pic over a length-prefixed report instead of writing $TMPDIR/pic-bash-*. The truncation notice names pic:output/<id>, which the read tool opens with its usual offset and limit; to search it, the notice says to rerun the command with a filter. closed check-in: 88cfdf0095 user: dmestas tags: spill | |
| 17:24 | CI green on 34868fb74a7a; Fil-C pass check-in: 9304258f7d user: dmestas tags: trunk | |
| 17:09 |
Conversations as rows of picu_pi_session_line for ctx (ticket 467ff3edef)
The Pi v3 lines pic exports for ctx now go into picu_pi_session_line in ~/.pic/pic.sqlite: one row per line, append-only per conversation, deflated when smaller by the SQLite Archive rule, with the line's Pi type and the journal entry it came from. Exporting again adds only what is new; a rename adds one line. Until ctx reads the rows the ~/.pic/sessions files are still written; piSessionFiles=0 stops them. pic export --pi DIR still writes files there, and - writes to standard output. closed check-in: 34868fb74a user: dmestas tags: rows | |
| 16:52 | CI green on 7ba00eb0a394; Fil-C pass check-in: 26395fd459 user: dmestas tags: trunk | |
| 16:36 |
Link zlib into the model test on the Fil-C host
The sqlar functions catalog.c now uses need zlib; the payload linked the model test with SQLite alone. closed check-in: 7ba00eb0a3 user: dmestas tags: userdb | |
| 16:11 |
Give the Fil-C payload a private HOME
pic keeps user state under $HOME/.pic; the remote run now keeps it inside its own directory, which teardown removes, and runs the catalog offline. check-in: fc236129ed user: dmestas tags: userdb | |
| 16:10 |
User state in ~/.pic/pic.sqlite instead of loose files (ticket 2ad667b78b)
pic's user-level state now lives in one SQLite database, shared by every pic process (WAL, a busy timeout), in tables prefixed picu_: settings, the model catalog cache from pi.dev (stored with the SQLite Archive compression rule; sqlar_compress and sqlar_uncompress are registered), project trust, model scopes and the workspaces pic has used. ~/.pic/settings.json and ~/.pic/models-store.json are imported on first open in one transaction and then deleted. pic settings shows and changes settings. Tests and benchmarks now run with a private HOME and an offline catalog, so they no longer read or write the real ~/.pic. check-in: dd27c70e9d user: dmestas tags: userdb | |
| 15:45 | CI green on 998e8169f137; live check on three providers check-in: 5058e3b40f user: dmestas tags: trunk | |
| 15:39 |
Thinking levels as in Pi, for every API
Pi's levels (off, minimal, low, medium, high, xhigh, max) limited to what each model supports per Pi's catalog (thinkingLevelMap, now in the built-in snapshot), and sent as Pi sends them: Anthropic adaptive thinking with effort for models that force it, otherwise thinking budgets with max_tokens raised, disabled when off; Chat Completions by thinking format (reasoning_effort, OpenRouter reasoning, DeepSeek and Z.ai thinking, Qwen and Together switches); Responses reasoning.effort. The level comes from --thinking, else the saved per-model or default level, else medium; pic models --thinking-default saves the default and pic models --json lists each model's levels. agent_start reports the level. closed check-in: 998e8169f1 user: dmestas tags: thinking | |
| 14:32 | CI green on 1e04dff70e05; Fil-C pass check-in: 5451d909db user: dmestas tags: trunk | |
| 14:17 |
Ship generated .inc sources to the Fil-C host
The remote run copies sources by extension and left out the generated model catalog (src/model_catalog.inc). closed check-in: 1e04dff70e user: dmestas tags: models | |
| 14:01 |
Model picker, slash command menu and Pi's model catalog
Models are chosen as in Pi. pic carries a snapshot of Pi's catalog for its providers (653 chat models; tools/model-catalog.sh regenerates it from pi.dev/api/models) and lays fresher per-provider lists from pi.dev over it, cached in ~/.pic/models-store.json with ETags and trusted for four hours, used only when newer than the snapshot. Resolution takes a model's API, endpoint, limits and compat settings from the catalog before the models file. pic models lists the models of providers with a key (--all every one, --json, --refresh); pic models --default saves the model used when none is given. In the terminal interface, Ctrl+L or /model opens a picker of the models whose provider has a key, filtered by Pi's fuzzy matching as you type, current and default first; Enter uses the model, Ctrl+S also saves it as the default; Ctrl+P cycles. Typing / shows a menu of commands with their arguments (Tab completes, Enter runs) and /model completes model names. New commands show the conversation's details and token counts, copy the last reply (OSC 52 and the system clipboard), export, clone and list the hotkeys. check-in: fb82c37817 user: dmestas tags: models | |
| 13:34 | CI green on fc4294d0eafd; Fil-C pass check-in: ad4310396c user: dmestas tags: trunk | |
| 13:19 |
Harden the terminal interface after review
Quitting or pressing Esc again while a request will not stop now escalates from SIGINT to SIGTERM to SIGKILL instead of hanging; a terminated or crashed interface cancels its running request and puts the terminal back; a request that exits without its events is reported. A run is settled when the child exits, not when its output closes. Children run detached from the terminal and get none of the interface's descriptors. Text is sanitized before it reaches the screen: only colour escapes survive, other escapes and control characters are dropped. A streamed reply is committed early only by whole lines, so a resize cannot duplicate or lose text, and a cut-off reply that had lines committed says so. Split key sequences on slow links are kept for the rest; the renderer redraws fully after a resize even when output was committed first. The interface's unit tests run under Fil-C too. closed check-in: fc4294d0ea user: dmestas tags: tui | |
| 13:09 |
Add a terminal interface: plain pic in a terminal
A module in the pic binary (src/tui) that runs each request as a child pic --json process and knows it only through its events, so a fault in the interface cannot touch a run. Finished output is committed once to the terminal's scrollback; a small live area (the reply being streamed, a running tool call, status, queued messages, the editor and a footer with the directory, conversation, tokens, context and model) is redrawn from its first changed line, inside synchronized output. A reply that fails mid-stream only ever lived in the live area and simply goes away. Editor: multi-line, history, bracketed paste with large pastes shown as atomic markers. Keys: Enter sends (queues while a reply runs), Ctrl+J or Alt+Enter adds a line, Esc interrupts, Ctrl+C clears and twice quits, Ctrl+D quits, Ctrl+O expands later tool output. Commands: new, resume with a picker, name, fork, compact, model, help, quit; commands typed during a reply wait for it. pic tui -c continues the latest conversation and shows its history; pic chat remains the plain prompt. For clients, agent_start now carries the conversation, model and context window and message_end the usage; the conversation list and a conversation's entries are available as JSON. Tested with unit tests for the width, key, render and editor modules and end to end on a pseudo-terminal. check-in: cb2ad5fbe9 user: dmestas tags: tui | |
| 12:49 | CI green on acbf15df96dc check-in: 736c8c70b6 user: dmestas tags: trunk | |
| 12:45 |
Fix the usability problems found by test runs on real tasks
pic log now shows how a request ended when it was not answered (cancelled, failed with its error, or still running). pic chat -c continues the latest conversation, or a given one by id, and the prompt says which. A wrong conversation id points at the listing command; a refused fork point names the latest valid ones; an unknown option or command says so before the usage text; an unknown slash command is reported as unknown. closed check-in: acbf15df96 user: dmestas tags: dogfood-fixes | |
| 12:41 | CI green on a17b05aaa7ca check-in: 9d99f3d144 user: dmestas tags: trunk | |
| 12:36 |
Benchmark long conversations: the context estimate and a full request per API
A conversation of 100 read calls (about 200 entries, 400 KB) is built once; context/estimate-long times Pi's estimate in-process, and request/<api>-long times one whole pic run against a local server inside the benchmark (anthropic, chat, responses). Measured: the history adds about 3 ms to a request at this size (building the messages and body, sending them); the rest of a request is durable commits and process start. Baseline rows added; existing rows left as recorded. closed check-in: a17b05aaa7 user: dmestas tags: bench-long | |
| 12:16 | CI green on 193e5d1a30ec; Fil-C pass check-in: 3c23c4f6fa user: dmestas tags: trunk | |
| 12:01 |
Write conversations as Pi v3 session files for ctx and Pi's tools
pic export --pi [DIR] writes each conversation as an append-only Pi v3 JSONL file named as Pi names them, by default under ~/.pic/sessions/ --<cwd>--/ and never in Pi's own folder: entry ids are journal entry numbers, a fork names its source file, instruction updates are custom_message entries, names are session_info, compactions are Pi compaction entries. Exporting again appends only finished entries after the last one written, after cutting a torn last line. ask and the line mode export their conversation after each request (PIC_PI_EXPORT=0 turns that off). Also fixes compaction file lists: they were stored as JSON text rather than arrays, so a later compaction did not carry the earlier read and modified files forward. Lists already stored that way are read either way. closed check-in: 193e5d1a30 user: dmestas tags: pi-export | |
| 11:46 | CI green on dc583648f4b7; Fil-C pass check-in: 3f3d884187 user: dmestas tags: trunk | |
| 11:32 |
Check event JSON with sqlite3 only where the command exists
The Fil-C host has no sqlite3 command; the events test now skips just that check there, as the migration test does. closed check-in: dc583648f4 user: dmestas tags: events | |
| 11:17 |
Add an interactive line mode: plain pic in a terminal, or pic chat
A prompt that continues one conversation: each message streams its reply, Ctrl-C cancels just that reply, a line ending in a backslash continues the message, and Ctrl-D or /quit leaves. Slash commands start, resume, list, log, name, fork and compact conversations and change the model. The journal is opened only while an input is handled, so other pic commands can use it while the prompt waits. check-in: f41f8c8e00 user: dmestas tags: events | |
| 11:13 |
Ctrl-C cancels the running request, not pic
The first Ctrl-C sets a flag that network waits, retry pauses and the bash tool notice: a running command is aborted through its supervisor and its output kept ("Command aborted"), a provider request stops waiting and is not retried, and the run loop cancels that request the way pic cancel does, leaving other queued requests alone. A second Ctrl-C exits at once and the next run recovers as before. pic also ignores SIGPIPE, so a reader that goes away does not stop a run. check-in: 0dececc6d4 user: dmestas tags: events | |
| 11:05 |
Stream live events: Pi's JSON-mode events, or the reply as it arrives
--json writes one event per line as the run goes, with Pi's names and shapes: agent, turn and message start and end, text and thinking deltas from every adapter, tool execution start and end, compaction start and end, and auto_retry_start. A reply cut off mid-stream ends in message_end with stopReason error before it is requested again, so a client drops the partial text. pic ask streams the reply text when stdout is a terminal (--stream forces it) and prints it only once; tool calls stay on stderr. Events are not journaled: the journal remains the record. check-in: 9983dd9955 user: dmestas tags: events | |
| 10:49 | CI green on 99cd3b102938 check-in: 1ca1db547f user: dmestas tags: trunk | |
| 10:45 |
Export finished entries as JSON lines for ctx and other readers
pic export [--since ENTRY] writes each finished entry: conversation, entry number, parent, request, role, time, workspace, model, text, tool calls, tool results and whether it is the final answer; thinking is left out. The entry number is the cursor, so there is no outbox table: export stops before the first entry of any unfinished request, and a reader that keeps the last number it saw never skips or repeats one. closed check-in: 99cd3b1029 user: dmestas tags: export | |
| 02:51 | CI green on dae7ef5eda51 check-in: 134a797840 user: dmestas tags: trunk | |
| 02:48 |
Join reply text blocks with a newline, as Pi's contentText does
The conversation sent for summarizing and the summary taken from the reply joined several text blocks with nothing; Pi joins them with a newline. Checked against the Pi copy in reference/pi. closed check-in: dae7ef5eda user: dmestas tags: compaction-text | |
| 02:45 | CI green on 54530144915b; Fil-C pass check-in: ce00efcddd user: dmestas tags: trunk | |
| 02:30 |
Compact long conversations with Pi's algorithm, for any model
Before each reply pic estimates the context as Pi does (the last reply's usage plus chars/4 for what followed) and past the model's window minus 16384 tokens it summarizes the history beyond the newest 20000 tokens, cutting only where a call is not separated from its result and handling a split turn as Pi does. The summary requests use Pi's prompts and serialization, are journaled as generations of their own and retried like replies; the summary, read and modified files, the first kept entry and the tokens before commit together. Requests then send the summary, the kept entries (rebuilt without thinking when older than the compaction) and what followed. Instruction updates that were summarized go out again. A context overflow compacts once and retries; pic compact asks for one before the next request; --context-window overrides the window. Schema 6. closed check-in: 5453014491 user: dmestas tags: compaction | |
| 02:07 | CI green on ffaf5a4afb70 check-in: 91916aa053 user: dmestas tags: trunk | |
| 02:04 |
Add follow-up conversations, forks and in-place instruction updates
Entries form a tree: a trigger links each new entry to its conversation head and moves the head, inside the inserting transaction. Requests are built from the path, so pic ask -c and an explicit id continue a conversation and pic fork branches one from a point that ends a turn. Each conversation freezes its opening prompt and tools; edited project instructions are appended once as an update at that point. New commands list, name and print conversations. Schema 5, with journals of earlier versions stepped up in place. closed check-in: ffaf5a4afb user: dmestas tags: stage-5 | |
| 01:52 | Plan: project instructions update a running conversation, appended check-in: 9b6a8e0082 user: dmestas tags: stage-5 | |
| 01:40 | Plan stage 5: follow-up conversations, branching and compaction check-in: a048da0814 user: dmestas tags: stage-5 | |
| 01:39 |
Land stage 4: any model
A model registry, a provider-neutral journal, and adapters for the Messages API, Chat Completions (OpenAI, OpenRouter and compatible servers) and OpenAI Responses, with conversations moving between them. check-in: aca81cd9e3 user: dmestas tags: trunk | |
| 01:36 | Record stage 4: any model, done closed check-in: 92fa046e46 user: dmestas tags: stage-4 | |
| 01:16 | Fil-C payload: build all three decoders and run the registry tests check-in: 6ecb1963da user: dmestas tags: stage-4 | |
| 01:15 |
Benchmark each decoder and parse a chat chunk in one cached query
make bench-pic now decodes one realistic reply (500 text deltas and a 50-piece tool call) per API. It showed the Chat Completions decoder at 9.8ms against 1.3ms for the Messages API decoder, because it compiled about ten statements per chunk; one cached query per chunk and per tool delta brings it to 1.9ms. The baseline gains the decoder rows. check-in: 0e4ade46bb user: dmestas tags: stage-4 | |
| 01:08 |
Add the OpenAI Responses adapter
Output items are kept whole, so reasoning items with encrypted_content go back verbatim to the same model under store:false; the final output list is authoritative and fills in late encrypted_content. The neutral form follows Pi: reasoning to thinking, messages to text, function calls to tool calls with call_id|item_id ids. Requests send input items, function_call_output under the call ids, flat tools, and reasoning effort with encrypted reasoning for reasoning models. Recorded streams, a fuzz target and fake server cases cover it, including conversations moving between the Messages API and Responses both ways. check-in: dd694d986b user: dmestas tags: stage-4 | |
| 00:56 |
Add the Chat Completions adapter for OpenAI, OpenRouter and compatibles
A chunk decoder following Pi: text, reasoning from reasoning_content, reasoning or reasoning_text kept under its field, OpenRouter reasoning_details verbatim, tool calls by index, usage, finish_reason, and in-stream errors. Requests follow Pi too: system or developer role, tools as functions, tool messages, stream_options, store and reasoning by dialect. The retry loop and header assembly move into a shared module both adapters use. Recorded streams, a fuzz target and fake server cases cover it, including a conversation moving between the two APIs in both directions. check-in: 55cff08c2c user: dmestas tags: stage-4 | |
| 00:38 |
Journal every reply in two forms and convert across models
Assistant entries keep the provider content verbatim with its origin (provider, api, model) and Pi neutral form; tool calls come from the neutral form, the same for every provider. A turn goes back verbatim to the model that wrote it and is otherwise rebuilt from the neutral form, without thinking and with tool-call ids normalised identically in calls and results. --model resolves through the registry, keys come from the model, and schema 3 journals migrate in place on open. check-in: 3ff8346a3f user: dmestas tags: stage-4 | |
| 00:24 |
Add the model registry: provider/model names, Pi compat, models.json
Built-in providers carry the base URL, wire API and key variable Pi uses for them; OpenAI-compatible dialects are detected from provider and base URL as Pi does; ~/.pic/models.json, or an existing Pi models file, adds providers such as a local server and overrides any field. check-in: 42a80c44fd user: dmestas tags: stage-4 | |
| 00:23 | Bring CI and its test fixes into stage 4 check-in: f40e74ccdb user: dmestas tags: stage-4 | |
| 00:23 |
Land CI: the full suite on every push, on the Mac runner
Adds ci/test.yml and its docs, and the fixes the first runs exposed: build paths quoted for directories with spaces, and crash tests that wait on signals from the running command instead of fixed sleeps. check-in: a515a7995c user: dmestas tags: trunk | |
| 00:20 |
Hold the first pic until the test is done with it, not for seconds
The CI runner is a launchd agent that macOS throttles, so a second writer could start after the first had finished its fixed sleep and run to completion. Commands in the lock and orphan tests now wait for a release file the test creates when it is done, and the background-child test proves pic returned before releasing the child. The suite passes under full CPU load. closed check-in: 445b149716 user: dmestas tags: ci | |
| 00:14 |
CI: print the runner limits and fence-test evidence on failure
The single-writer test fails only inside the CI runner, never in a faithful reproduction outside it. CI now prints the job limits first, and the fence test prints the first writer, the processes, the lock files and the second writer output when it is admitted. check-in: 370e28623f user: dmestas tags: ci | |
| 00:07 |
Wait for proof the first pic holds the journal, not a fixed second
Four crash cases slept one second and assumed the backgrounded pic had taken the lock and started its command by then. On the CI Mac, running two jobs at once, it had not, so the second writer was admitted. Each case now waits for a file its running command creates. check-in: 2e10ee615e user: dmestas tags: ci | |
|
2026-11-18
| ||
| 23:54 |
Quote build paths so the suite runs from a directory with spaces
CI on the Mac runner works under Application Support, and the unquoted $(CURDIR) paths split at the space, failing the provider suite before it started. Every path handed to the test scripts is quoted now. check-in: 13f2d57321 user: dmestas tags: ci | |
| 23:44 |
Use the forge runner installer instead of hand-written scripts
quarry-runner install now sets up the Mac runner in one command, collects its own token, and uninstalls cleanly, so the hand-written LaunchAgent scripts go and docs/ci.md describes the installer. check-in: 8b2ef45a57 user: dmestas tags: ci | |