Skip to content

feat(agent): journey evals across 24 apps, and the agent fixes they found - #6

Merged
codemug merged 15 commits into
mainfrom
feat/agent-journeys
Nov 26, 2026
Merged

codemug merged 15 commits into
mainfrom
feat/agent-journeys

Conversation

@codemug

@codemug codemug commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

WebPC Agent gets a journey eval suite: 213 user journeys across 24 apps, 207 of them runnable today, each with a model-free oracle that proves the journey can be done with the tools, and an end-state check through the app's own API. This PR carries the suite, the queue runner that plays them through one shared browser session, and the agent, runtime and app-pack fixes the journeys found on lfm3-1.7b. It also carries the earlier agent-model work (Gemma 4 E2B in the model list, LFM3-Omni groundwork, asking a question by microphone).

Stacked on #5, which is merged (950ece0); this PR's base is now main. Merging it starts no site deploy: the site picks up the new release on its daily schedule.

What changes

Journey evals (tests/agent-eval/journeys/<app>.yaml, one file per app)

  • 213 journeys in 24 apps. Of the 207 runnable ones, 156 are train and 51 holdout; holdout results are never shown to whoever fixes skills. Prompts are long and specific, the way a user writes: a three-month budget with dated rows and formula columns, a command run in Linux with given parameters, a slide deck from a table, a PDF page inserted and saved.
  • Every journey has an oracle: the exact tool calls that achieve it, run with no model through the same checks. A journey no tool can do yet is marked needs: with the missing piece named (6 journeys).
  • Checks read the end state through the app (cells, documents, files, the guest's shell), not the agent's reply.
  • scripts/agent/eval-queue.mjs runs requests from a queue folder through one shared browser session, oracle requests first. It survives a crashed or closed page, loads each journey file on its own, and skips refused calls when reading a trace.

Runtime (src/apps/ai-agent)

  • Argument repair: a key=value value runs to the next key; a loose-JSON blob or a comma string meant as a table is unwrapped, or refused with the rows form to copy.
  • Loops: a later call that fixes a failure's cause clears the repeat stop; discovery closes after 8 searches in a row and names the next step; a third identical call with the same result returns that result with a note instead of running again.
  • Search: the app the user names ranks first, then the app on screen.
  • Long runs: older tool results are trimmed in the prompt before the context limit, an empty answer gets one retry, the reply cap is 2048 tokens, and a model that stalls before its first token shows an error after 60 s.

App packs (agent/apps, agent/files, agent/desktop)

  • Flat tools for the core create verbs, which a 1.7B model reaches where run_command or a script does not: CADCraft line, circle, move and text; EffectCraft project, comp, text layer, solid and item; FilmCraft sequence; Files move.
  • Honest failures where the app reports success but nothing happened: PDFCraft close, LightCraft delete, an empty CyberChef bake, a Packets list or filter with no capture open.
  • Teaching errors whose fix line is a copyable call, and skills that type the user's values first and stop after a read-only answer.
  • No skill or tool example shares a value with a journey prompt (109 values replaced), so the scores measure general skill, not copied answers.

Terminal: terminal.run proves the shell is ready with a hidden sentinel before the first command of a boot, and again after an empty result, so a dead output channel is an error within 5 s instead of empty successes.

Agent models (earlier commits on this branch): Gemma 4 E2B in the model list, LFM3-Omni log-mel features and decode runtime, and a microphone button that records a question.

Eval (final build, lfm3-1.7b)

Every journey's oracle passes on the final build (207/207, and on every build since the oracle first went green), so every failure below is the model, a skill or the runtime, not a broken journey. No skill or tool example shares a value with a journey prompt.

Measure Result
Train, one run per journey 112/156 (72%)
Train solved (passed on the last two builds) 104/156 (67%)
Holdout (never shown to whoever fixed skills) 33/51 (65%)
Older task suite (tasks.yaml, 62 tasks) 42/62 (68%); end-state checks alone 52/62 (84%)

Per app, train ("Final run" is one run on the final build; "Solved" passed on both of the last two builds):

App Final run Solved App Final run Solved
beepbox 6/6 6/6 lightcraft 5/6 5/6
cadcraft 6/6 6/6 materialcraft 4/4 4/4
cyberchef 0/7 0/7 media 6/6 6/6
deckcraft 6/9 4/9 nettools 4/5 4/5
desktop 8/12 7/12 packets 6/6 6/6
docs 3/9 3/9 pdfcraft 1/5 1/5
effectcraft 4/6 2/6 photocraft 4/4 4/4
excalidraw 6/6 6/6 soundcraft 4/4 4/4
figcraft 6/6 4/6 sqliteviz 4/6 4/6
files 5/9 5/9 terminal 6/9 6/9
filmcraft 5/6 4/6 texturecraft 4/4 4/4
gridcraft 4/9 4/9 vectorcraft 5/6 5/6

On the build where the copied example values were first removed, the train score was 101/156 (64%); it reached 72% over the next three builds. The holdout, first run one build before the final one, went from 29/51 to 33/51.

Other in-browser models, on the same 24 journeys (one train journey per app):

Model Pass
lfm3-1.7b 20/24
gemma4-e2b 12/24
qwen3.5-0.8b 5/24
qwen3.5-2b 3/24 (11/150 on the full train set: it repeats the same skill search until the round cap and never acts)

lfm3-1.7b stays the default for app work. What still fails is mostly the model's own precision: in CyberChef (0/7) a mistyped character, the wrong direction or an amount it was taught and ignored; in PDFCraft, Docs and GridCraft, losing track of state across many writes. In most of these the tools already teach the right call.

How it was checked

  • node --test tests/*.test.mjs: 1438/1438 pass on this head.
  • npm run build: passes; dist 778 MB (budget 990 MB).
  • Oracle run of every journey with no model: 207/207 on the final build.
  • Model runs: Chrome with WebGPU (Apple Metal), one shared browser session, one run per journey per build; a journey counts as solved only after passing on two consecutive builds.
  • Fitting check: a scan of every skill and tool example against every journey prompt finds no shared value, apart from two reviewed cases (a code comment the model never sees, and FilmCraft's Video and Audio category names).
  • Holdout: run by the lead only; its results were never shown to the teammates who fixed skills.
  • Not run: Safari, Firefox, Windows and Linux browsers, a physical phone; holdout repeats beyond the last two builds.

omni/mel.js ports Lfm3OmniFeatureExtractor's log-mel recipe (n_fft 400, hop 160, 128 slaney mels, log10 floor -12, (x + 4) / 4), matching a numpy reference bit for bit on the tests' fixtures. omni/plan.js holds the 1024-token prefill chunks, the initial conv and attention cache shapes from LFM3-Omni-2B's config, and the audio placeholder count and expansion. Not wired into the model worker yet.
Gemma 4 E2B (onnx-community/gemma-4-E2B-it-ONNX, Apache-2.0, pinned revision) loads on the pinned Transformers.js 4.3.2 as one multimodal model: all four q4f16 graphs, 3.38 GB, each file under Chrome's 2^31-byte Response limit (the q8 embeddings have a 2.35 GB shard and fail to cache). The worker renders its chat template through the processor, keeps image and audio parts in place, and decodes with special tokens so gemma-calls.js can turn its <|tool_call>call:NAME{...}<tool_call|> markup into the canonical form; the stream shows only the prose before a call. Measured on Chrome with an Apple GPU: cached load 9 s, 22 tok/s; eval set A 3 of 20 without the skill note (LFM3: 15 of 20), so the picker help points app work to LFM3.
omni/runtime.js encodes audio through the encoder graph and decodes greedily: every feed comes from the decoder's own input names, the 35 past_* caches start from initialCaches and are replaced by each step's present_* outputs, the prompt prefills in chunks of at most 1024 tokens with the audio rows on the chunk that holds the <|audio|> placeholders, and the reference's suppressed ids (<|audio|>, <|audio_out|>, <|mixed_start|>) are never picked. float16 logits arrive as raw Uint16Array bits from onnxruntime-web and are decoded before the comparison. Unit-tested with fake sessions; not wired into the worker yet.
Models that hear audio (MODELS[key].audio, Gemma 4 E2B now) get a record button in the composer: up to 30 s, resampled to 16 kHz mono, shown as a chip and sent with or without text. The samples ride only on that turn's prompt as an audio part; the stored chat keeps an [audio N s] marker, and the storage boundary strips audio like images. The agent panel's frame allows the microphone. The browser spec uses Chrome's fake microphone and a scripted worker.
A repeated identical lookup_skill_index, find_tool, find_in_skill, describe_tool or read_skill used to come back as a 'repeated' error that pushed the earlier top hit (for 'create a column of months' that was sqliteviz/inspect-the-schema). The call now runs again and its result carries a note: same results, read or call one of them, or search with different words; a repeated read also names the first step. No hit is picked for the model. A third identical action call still stops.
…t fixes they found (checkpoint)

24 journey files (about 230 journeys), fixtures, the oracle and queue runner, and the fixes the
oracle and the lfm3 baseline exposed: fresh app state per journey, argument unwrapping, the
search-loop nudge, stop messages that name the fix, open windows in the turn note, find_tool
keywords, tolerant CyberChef names, missing-folder saves, and new PDFCraft and Docs tools.
The agent loop, argument repair and search gained the fixes the journey
sweeps found on lfm3-1.7b:
- a value written as key=value runs to the next key, not the first space;
- a later call that fixes the cause clears the repeat-stop memory;
- discovery closes after 8 searches in a row, a reopen lasts 3, and the
  close names the next step, or the tool when the query names one;
- a third identical call with the same result returns that result and a
  note instead of running again;
- the app the user names, then the app on screen, ranks first in search;
- a loose-JSON blob or a comma string meant as a table is unwrapped or
  refused with the rows form;
- older tool results are trimmed in the prompt before the context limit,
  and an empty answer gets one retry;
- the reply cap is 2048 tokens, and a model that stalls before its first
  token shows a visible error after 60 s;
- the trace records the tool that actually ran.
terminal.run echoes a random sentinel and waits for it before the first
command of a boot, because the guest reported ready while its shell still
swallowed the first commands (they came back as exit 0 with no output).
A run that returns exit 0 with empty output proves the shell again, so a
dead output channel is an honest "not running" error within 5 s instead
of empty results for every later command. The probe never shows in the
user's terminal.
Each app's tools and skills gained what its journeys showed a 1.7B model
needs:
- flat tools for the core create verbs (CADCraft line, circle, move and
  text; EffectCraft project, comp, text, solid and item; FilmCraft
  sequence; Files move);
- honest failures where an app reports success but nothing happened
  (PDFCraft close, LightCraft delete, an empty CyberChef bake, a Packets
  list or filter with no capture open);
- teaching errors whose fix line is a copyable call (empty GridCraft
  ranges, unknown sheet names, run_command ids, re-opening an open file,
  VectorCraft and FilmCraft argument shapes);
- skills that type the user's values first, read before acting, and stop
  after a read-only answer.

No skill or tool example shares a value with a journey prompt, so the
journey scores measure general skill, not copied answers.
The eval runner loads each journey file on its own, so one file that does
not parse fails only its own requests. Its trace readers skip refused
calls, so a refused repeat at the end of a run no longer hides the last
real result.

Journey corrections, prompts unchanged:
- Terminal journeys whose checks need the terminal open it in setup;
- checks that pinned an incidental id or an oracle-only read now read the
  app's end state (FilmCraft 03/04, LightCraft 01/08, Docs 07/11,
  Terminal 07/08);
- LightCraft 05 is needs: (this build never shows a deletion in reads);
- broken oracle steps are fixed (the Docs 07 paragraph index, a PDFCraft
  05 step that cannot work in this build, the CADCraft oracles now use the
  flat tools);
- one probe journey is removed.
A Craft app whose page stops answering (a dialog, a long conversion)
could hold an open or save call forever, because the app's own timeout
runs in the same blocked page. Every cross-frame call on the open and
save paths now has its own time limit and fails with an honest error
that says a dialog may be waiting.

GridCraft names the existing table when a new one would overlap it, so
the model stops re-creating it, and a table value that looks like a 2D
array but does not parse is refused with a copyable two-row example.
tool_result takes any: true, so a journey whose prompt does not fix the
order of commands passes when any run of the tool shows the result, not
only the last. Terminal journeys 01, 03, 04, 09 and 10 use it; those
whose prompts say how to finish keep the last-run reading.
…lists

A Craft app opened again over its own open document showed a dialog that
blocked the app, so the model's "check it loaded" re-open hung DeckCraft
until the turn timed out. A successful open now says the file is open and
that inspect is the way to check, and DeckCraft treats a re-open of the
open deck as already open.

A command sent as a JSON list (["ls", "-la", "~"]) runs as one command
line instead of the list text. Smaller guards: EffectCraft refuses
animation text in a property value, PDFCraft says when a search ran but
gave no match details, and example values in the Docs and FigCraft tools
share nothing with any journey.
When a journey hits the turn timer, the result now holds the partial
trace (a call in flight included), the last chat text and the model
status, which is how the DeckCraft re-open hang was found. The first load
of a large model may take up to 20 minutes.

Journey checks that pinned something the prompt never asked for are
corrected, prompts unchanged: Desktop accepts a total written with a
thousands comma, FigCraft 08 no longer pins a document name the prompt
does not give, and Media 04 accepts the live position the player shows
after a seek.
A Craft app page that freezes its main thread freezes the agent frame too,
since same-origin frames share it, so the capture of a timed-out run could
wait forever and stall the whole queue. It now gives up after 15 s and
records the timeout without the capture.
@codemug
codemug changed the base branch from feat/terminal-unkernel to main November 26, 2026 14:19
@codemug
codemug marked this pull request as ready for review November 26, 2026 14:20
@codemug
codemug merged commit f3b795c into main Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant