Repository navigation
feat(agent): journey evals across 24 apps, and the agent fixes they found - #6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)needs:with the missing piece named (6 journeys).scripts/agent/eval-queue.mjsruns 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)App packs (
agent/apps,agent/files,agent/desktop)run_commandor a script does not: CADCraft line, circle, move and text; EffectCraft project, comp, text layer, solid and item; FilmCraft sequence; Files move.Terminal:
terminal.runproves 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.
Per app, train ("Final run" is one run on the final build; "Solved" passed on both of the last two builds):
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):
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).