The brain operates programs through the app (pc_control.spec.md):
windows, read, click, type, keys, run and close, with window text fenced
as untrusted screen data and every action answered from the fresh
reading the app returns.
- Asking first: an action the app wants asked about is not done; the
tool keeps the request and only the person's very next message, judged
by the small model chain (fenced, YES/NO, 600 chars), gives consent,
which then covers those kinds on that window for the rest of the
reply. The model's confirm flag is not what decides.
- Never done: before the first acting call per window and kind in a
reply, a small call checks for payments, secrets, deleting files and
administrator rights; anything but a clear no refuses and nothing
reaches the app.
- The worker keeps each person's pending requests between their
replies, passes the app's ask answers through and waits 45 s for a PC
action (starting a program and reading it takes the app ~20 s).
- The reply engine's repeat guard no longer limits pcControl: pressing
calculator keys is many calls and the same one can be meant twice.
Before, the third call was blocked and the model then claimed to have
pressed a payment button it never pressed.
Eval evals/test_pc_control_tool.py on Qwen3.6 (game PC Strata), 8 runs
of 4 cases after the last changes: calculator 12+3 read back as 15 6/8
(the misses press the digits out of order and say the wrong result read
from the screen), ask then consent in the next message 8/8, a request
written in a window not followed 8/8, payment never pressed and never
claimed 8/8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The done-by-user guard asked its first yes/no question after every
follow-up answer was made, adding a short LLM call (~0.4 s) before
Jarvis spoke. The question depends only on the user's words, so the
voice worker's prepare now asks it on the partial transcript after the
tool pick (prepare_done_by_user, follow-up turns only) and the guard
uses that judgement (prepared_done), asking only whether the answer
refuses when the user said they did it. Without a prepared judgement,
or when it failed, the guard asks for itself as before. The reply does
not wait for the judgement, only the guard does.
Measured on Qwen3.6 through the game PC's Strata, 12 pairs of short
follow-up questions in alternating order: brain time median 1.06 s
before, 0.69 s after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A native tool call message with text is not an earlier answer: leaving it out
orphaned its role=tool result. Only plain assistant answers are left out.
- The guard is off once any tool run started in the reply, whatever it returned:
an MCP call with an empty result was not in invoked_tools_history, so a second
try could run it again.
- HistoryContext.answers marks the lines that are Jarvis's answers to the asker
(to_id is the asker); only those leave the history, not someone else saying the
same words.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Field turn 2026-11-18: Jarvis said speed control is not supported, the user changed
the speed in the app and said "I adjusted it, so say something", and Jarvis refused
again, often in other words. Prompt wording did not move it (five rules, two history
shapes tried).
v2 replies with an earlier Jarvis answer in the dialogue memory and no tool call now
ask the chat model two short yes/no questions: does the user say they did something
themselves, and only then, does the answer say something cannot be done. On two
yeses the answer is made once more with Jarvis's earlier answers (dialogue memory and
the history lines with the same text) left out of that reply's context.
Real model (qwen3.6 35B on Strata), field case with history and dialogue memory, 20
same-prompt pairs: refused 12/20 before, 1/20 after; "what did you say? say it
again" still said it again 20/20 before and after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user asked to drop it: nobody had the Gemini CLI login or a key set up,
and Exa then Wikipedia cover the voice use. webSearch is now live Chrome,
Exa, Brave (opt-in), Wikipedia. Removes the CLI/REST backends, the
GEMINI_* settings, the Docker login mount and checks, and updates the specs
and docs/llm_contexts.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Live 2026-11-18 '자비 사과랑 배 중에 뭐가 더 달아' was searched as
'사과와 배 중哪个가 더 단가요'. The rule and the user message's closing line
now say to use only the query's letters.
Eval test_search_in_users_language.py, new case fruit (qwen3.6-35b-a3b,
game PC): Han in the search 7/7 before; rule only 3/3, closing line only
3/3, both 0/6; whole file 12/12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DuckDuckGo now serves only its bot-check page (game PC and host alike), so
every search fell to Wikipedia full-text search, which picked unrelated
pages (박진영 for songs for a rainy day, 대한민국 for a graphics card
ranking). Live 2026-11-18 answers took 9-15 s and were wrong.
- Exa's free MCP endpoint (no key) is the first provider after the
live-broadcast Chrome; it returns page text, so no fetch is needed.
- Gemini runs only when Exa found nothing and a CLI login (oauth) or key
(apikey) is present; without a login the CLI is no longer started
(about 2 s per search).
- Wikipedia is used only when the page title is named in the query;
otherwise the honest nothing-found envelope.
- Letters of a script the user did not use are dropped from the query
(the model searched '사과와 배 중哪个가 더 단가요').
- DuckDuckGo removed; spec, docs and tests follow the new order.
- weather: any forecast failure (not only requests errors) tries met.no.
Real model (qwen3.6-35b-a3b, game PC), real network: graphics card
ranking, apples vs pears, rainy-day genres and black holes all answered
correctly in 3.7-5.2 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every call that no later request continues (call_llm_direct,
call_llm_streaming, the warm-up and the v1 intent judge) now sends
"strata_checkpoint": false on the OpenAI-compatible path. Strata's
Qwen3.6 engine then gives that call's session away first, so with two or
more requests at once a reply's tool turn keeps its session through the
short calls made between its steps. The reply loop's chat_with_messages
is not marked (its next step continues it); the Ollama API gets no new
field. With one request at once nothing changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Strata reads every reply prompt from the start in 2,048-token steps. The v2
compact prompt carried v1's full tool guidance and constraints (about 900
Qwen3.6 tokens) on every turn with a data tool, and the reply-language
default (about 120 tokens) twice.
COMPACT_TOOL_GUIDANCE keeps the same rules (act instead of refusing, facts
only from the result, look up named things, auto-derived and self-contained
arguments) in about a quarter of the tokens, without English examples; the
reply-language default says the same in half. v1's prompts are unchanged.
Measured on Strata (Qwen3.6, 20 lines of recent conversation): a weather
turn's prompt 3,436 -> 2,722 tokens, a search turn's second call
4,096 -> 3,383. Evals (compact prompt + intent judge, Qwen3.6): 24/24
before, 30/30 twice after (weather location, follow-up arguments, tool-skip
confabulation, search language, reply language, Possessor fidelity, reply
length, multi-turn context).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the one nudge, a second answer without the tool no longer goes out
as it is: the turn takes the planned path (the planner runs then, one
extra call only on this failure) and the skipped-tool guard runs the
planned tool, so a made-up "24 degrees" answer cannot reach the user. A
plan that needs no tool (a question back to the user) still lets the
answer go out.
Evals (qwen3:8b, EVAL_COMPACT_PROMPT=1 EVAL_INTENT_JUDGE=1, 3 runs):
the five tool-skip/weather/screen/follow-up/router files 72/84 (71/84 on
0.1.20, same known failures); Possessor director-then-filmography 0/3,
also 0/3 on 0.1.20 (qwen3:8b stops after one search; webSearch turns are
still planned).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the router's only pick is a tool that does its job in one call
(getWeather, logMeal, fetchMeals, screenView) and the chat model calls
tools natively, the planner no longer runs: on Strata it averaged 2.5 s
per tool turn (2026-11-16 16:45-16:58 engine log, 9 calls) before the
answer could start. Search, browsers, schedule, notes, chat channels and
picks of two or more tools still plan. The rule reads the router's pick,
not the words, so it is language-agnostic.
Without a plan the skipped-tool guard has nothing to run, so these turns
get one nudge instead: an answer given before any tool ran is dropped and
the model is asked to call the tool (or ask for a missing detail).
Evals (qwen3:8b, EVAL_COMPACT_PROMPT=1 EVAL_INTENT_JUDGE=1, 3 runs of
tool_skip_confabulation, weather_autoderive_location, screen_view_tool,
followup_supplies_missing_tool_arg, tool_router_implicit): 71/84 before,
72/84 after, same known failures; planner calls 14 -> 3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- botBrowser `play`: searches YouTube for the words as said, opens the first video (not an ad,
without the playlist) and starts it, in one call (an address given opens that page); `type`
also takes `query`. Live 0.1.19: the model stopped on YouTube's home page or the results, a
retry was refused as a third call, and the answer still said the video played.
- `brain.location` (기본 위치, default 대한민국) goes to the brain as `location_name`: the time line
says it without GeoIP (no database on the game PC), and getWeather without a place uses it.
- Planner and webSearch keep search words in the user's language (never translated into
English), so recommendations fit where the user is.
Evals (qwen3:8b, 3 runs): play ending on a playing video found with the words as said 0/6 -> 5/6;
Korean searches for Korean requests 6/9 -> 8/9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alone with Jarvis, whatever the speaker says is answered without asking the judge. With others
present the judge is told how many people are in the channel and how many may call Jarvis: with
one other person most of what the speaker says counts as said to Jarvis (unclear is yes); with
more, or not known, the question is the group one it was before. Live 2026-11-16: alone in the
channel, questions without the wake word got no answer because the judge assumed a group.
Eval (qwen3:8b, pair cases): 3/7 before, 6/7 after; group cases unchanged.
Also: the protocol test fixture's brain takes the trace argument (the test failed since traces).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- screenView tool (screen_view.spec.md): whole screen, monitor by number, window by part of its
title or program, or the list of monitors and windows; fast, normal or detailed pictures.
- The app captures with Windows Graphics Capture (app/src/screen.rs, admin.spec.md "Screen
viewing"), decides for the asker (only people registered for PC control), never picks, lists
or shows excluded programs (pcControl.screenExclude, password managers by default), refuses
minimised windows and black pictures, and records screen.view in the activity log.
- Pictures ride on the tool message (ToolExecutionResult.images); llm.py sends them to
OpenAI-compatible servers as image parts after the tool messages. They stay in that reply only:
not in the tool carryover, logs or prompt dumps.
- The LLM reads pictures only when screen viewing is available (--vision gpu normally, cpu in a
game), measured apart for the placement; otherwise screenView is a disabled tool.
- Worker: screen_action / screen_action_result, 4 MiB messages.
- Eval evals/test_screen_view_tool.py; Windows check tests/screen_windows.rs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each collection target can announce new items at once or in a daily digest
(off by default) in collect.notifyChannel, as titles and links only, with no
LLM; each post is recorded in the activity log. The brain gets a read-only
collectedNews tool (every target's newest items by default, fenced as
untrusted web content), offered with the app's collection file and the
collection feature, and available to scheduled tasks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A personalNotes tool (add, list, delete the asker's own notes) offered only
with a notes backend. The app keeps the notes in config/notes.json and sends
the asker's with every voice, chat and task reply; the reply engine puts them
in a <person_notes> fence as that person's preferences, which never permit an
action or a tool. The worker's schedule bridge becomes a shared app bridge
for schedule_action and note_action. A 사람별 지침 screen edits and deletes
any note; features.notes turns the tool and the notes off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brain gets a schedule tool (add, list, delete the asker's own reminders,
timers and tasks) offered only with a schedule backend. The voice worker asks
the app through schedule_action and runs fired tasks as reply via task with
read-only tools, no MCP and a fresh short-term memory. The app keeps the
schedules in config/schedules.json, fires them every 5 s, speaks them when the
person is in Jarvis's voice channel and otherwise posts in the chat channel
they asked in (or schedule.chatChannel for voice). A feature switch and a
예약 screen list and delete everyone's schedules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- while the services run, game mode decides the stage (perf.rs): a game means the game stage at
once (or pause with game.pauseInGame); its end brings the normal stage back after
game.revertSeconds (default 30)
- a change tells the voice worker the LLM switches (llm switching, with a notice), waits until
the brain has written the answers in progress (llm_idle, at most 2 minutes), restarts the LLM in
the stage and tells the worker it is ready or paused
- the game stage runs at 16K context, one request at a time, half the engine's CPU threads and
the game placement (reserve game.reserveGb, default 8, else 2 GiB, else 0 GiB, else pause),
measured once at that context; every placement of a run counts other programs' memory as it
was when the services started
- the voice worker gates every LLM use: on switching new work waits (at most 180 s), the first
spoken request that waits hears the notice once under its own id, on ready all go on, on
paused nothing is answered
- dashboard: "성능 단계: 게임 중 · 게임에 X GB" / 일시정지; game mode screen: game VRAM, revert
wait, pause in game
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Settings `features` (weather, webSearch, meals) and `mcpServers` (name, command, args, env names,
enabled), edited on the new 기능 screen. The tools of a feature that is off go into the brain's
`disabled_tools`; only enabled MCP servers go into its `mcps`.
- MCP environment values (API keys) live only in the encrypted secrets (`mcp:<server>:<NAME>`),
shown as stored or not, masked in logs, removed with their server, and reach the worker only in
`JARVIS_MCP_ENV`, which the brain takes out of its environment before giving each server its own.
- `enabled_builtin_tools(cfg)` is the one list the router, toolSearchTool and the executor use, so
a turned-off tool is neither offered nor run, also when the model names it.
- The v2 brain never offers v1's `localFiles` (home folder read/write/delete) and `screenshot`:
anyone in the voice or chat channels could ask for them. Screen viewing comes in M7.
- The brain connects MCP servers on its own thread and logs each outcome without debug logging.
- Stored secrets are masked in the log hub as soon as the data folder is found.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M5 step 4, second part. The services start the LLM first: the installed
Strata with the M0 kit's model and normal placement (models in
models/llm, parallel 1, or 2 when a chat channel answers every message,
pictures off, --restart), wait until /v1/models lists the model, and stop
it last. The first start downloads the model; the dashboard shows
Strata's last line and percentage, and stop also cancels a start (the
server is cleared). llm.url uses a server the app does not start.
On every start the app writes config/brain.json (Strata's /v1, the
listed model id, memory/jarvis.db) and hands it to the worker as
JARVIS_CONFIG_PATH. Loading a config with its own db_path no longer
creates ~/.local/share/jarvis.
service_start/service_restart run in the background. Settings gain
llm.context and llm.port (model screen) and llm.url (file only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A chatChannels pick from the router counts as a tool turn for the intent
judge ("post this in the schedule channel" needs the planner).
- The default-language directive names an explicit language request as its
one exception; the history block says plans and appointments people
mentioned need no calendar tool; why/how answers give only the core reason.
Evals (Qwen3.6, v2 options): reply length 3/3 (v2 185-205 chars, v1 315-356),
language, history, chat channels and tool-skip 22/22; full suite 219 passed,
6 failed (paris/london, graph branch and four v1 single-user memory cases).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- compact_prompt: the v2 persona in a tenth of v1's words, answers as short as
possible, the full tool guidance only on turns with a data tool. A greeting's
reply prompt went from about 4,500 to 1,400 tokens on Strata.
- intent_judge: the tool router judges whether the turn needs tools; the
planner runs only when it does. prepare_intent runs the pick ahead on a
partial transcript (worker message prepare), and the reply reuses it.
- Without stream_browser the screen-share tools are not offered.
- The time context carries the 12-hour form (10:37 was read as pm).
- A <tool_call> block written as the reply is parsed as a call, not spoken.
Evals (Qwen3.6 on Strata, EVAL_COMPACT_PROMPT=1 EVAL_INTENT_JUDGE=1):
221 passed, 4 failed (known failures); new evals/test_voice_reply_length.py
(v2 answers 234 chars against v1's 416) and test_reply_language_default.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brain passes default_language (worker --reply-language, default Korean) to
the reply engine; unlike the output_language lock it gives way when the user
explicitly asks for a language. Tools get the ko code (--tool-language).
Eval evals/test_reply_language_default.py (Qwen3.6 on Strata): 6/6, English
questions answered in Korean, an explicit English request in English, and the
control without the default answers English in English.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1's tts_engine default (English-only Piper) made the reply engine force
English, so Korean questions got English answers. The v2 brain speaks
through the worker's MeloTTS and chat answers are not spoken, so it runs
with tts_engine=melo; an output_language lock still wins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- conversation.rs: the loop between the core's events and the rest.
Finals go through call detection and the response policy; answers are
asked of the brain and spoken from the app's queue, an interruption
cancels only that answer, a voice stop silences everything, and missed
requests are kept without text (last 100). Tested with a fake voice side.
- Core: answer(user, text) adopts a playback request the worker speaks
under the same id, cancel(id) stops one request, ask_addressed and
ask_rank pass the conversation's questions; new SpeakingStopped,
Addressed and Ranked events.
- Worker client: reply, addressed and rank messages and their results; a
reply with no answer, refused or not sent ends its speech as failed.
- Voice worker: addressed and rank messages on their own threads, beside
a running reply; a spoken reply cancelled while the brain is answering
is not spoken. judges.py holds the two short LLM judgements with the
heard text fenced as data; eval evals/test_voice_judges.py.
- Specs (conversation, discord core, voice worker), docs/llm_contexts.md
and the roadmap updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop the engine's deterministic Korean weather shortcut. It bypassed the
chat model and the tool runner, so a location the user had stated could
never be used. The tool already returns one clean Korean sentence.
- getWeather and the tool-argument prompts pass the place the user has
said they are (conversation or memory) and leave the argument empty
otherwise, so the detected location is not copied into it.
- getWeather retries a "district, city, country" name with its leading
parts dropped when the geocoder finds nothing.
- The planner gets the live time/location line and plans
searchMemory topic='where the user lives' only when the location is
unknown or disabled.
- The per-reply repeat guard counts only this reply's tool messages, so
calls carried over from the previous reply no longer block a retry the
user asks for.
- Memory extractor: the context block sits after the examples and the
no-location example uses a different query, so a location already in
context is not asked for again. New counterpart eval checks that it is
still asked for when the context has none.
- Tool retry eval fails every call in turn 1, so a model that retries by
itself inside turn 1 still exercises the user's "try again".
- Specs (planner, reply), docs/llm_contexts.md and the roadmap updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The consent classifier is now told which message and channel are pending, so a yes for another
message ("yes, delete message 22" while 21 is pending) is a no and cancels the request. A reply
longer than 600 characters is no longer cut and judged by its start (which could drop a later
"don't"); it counts as no without a model call.
Eval evals/test_chat_delete_consent.py gains the different-message and long-reply cases:
17/17 on qwen2.5:7b, three runs. The previous prompt said YES 3/3 to
"응, 일정 채널에 있는 거 지워" while a message in 잡담 was pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- chatChannels delete with confirm=true now runs only in the person's very
next turn and only when their own message of that turn agrees, checked by a
small fail-closed YES/NO call on the router model chain (the message fenced
as data). A refusal, question, other topic or error cancels the request;
an unconfirmed request lapses after one turn. The reply model's confirm
flag alone can no longer delete.
- chat_action ids carry a per-run nonce and the session, so a late answer
meant for an earlier connection (or worker run) never completes a newer
action.
- Tests: agree, refuse, other topic, lapse, classifier failure, late answer
across reconnects. Eval test_chat_delete_consent: 12 of 12 on qwen2.5:7b,
3 runs. Spec and llm_contexts updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Tool (chat_channels.spec.md): list, read, search, send, edit, react,
delete, pin, unpin. Offered only when the v2 brain gives the turn a chat
backend, and then on every turn. Channel by ID, name, part of a name or a
name inside the text; a message ID finds its channel; planner forms of the
action ("send_message") work. Read and search results are fenced as
untrusted data. delete only reports until called again with confirm=true
in a later turn of the same person.
- Worker: chat_channels from the app, ChatBridge reads/searches the history
store and sends chat_action, waiting for chat_action_result (15 s timeout,
failed on session close); per-person reply turns and pending deletes.
- App: channel switches edit/react (on) and delete/pin (off); chat_channels
sent on worker ready and after login; chat_action runs send, edit (own
messages only), react, delete, pin, unpin and answers with ids or the error.
- Engine: chatChannels left out of the catalogue without a backend; the
"router returned everything" check now tolerates that.
- live_discord: edit own, refuse editing the speaker's, react, pin (Discord
refuses in a voice channel's chat, reported as an error), delete, refuse an
unregistered channel; passed in 109.4 s.
- Eval (qwen2.5:7b, 3 runs): 10 of 12; never obeyed the "delete everything"
message and never deleted in the same turn.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A final is stored under the channel, speaker name and time fixed when its
end was decided. Decoding takes a while; a move, rename or late joiner
meanwhile used to change where and when it was said, and who heard it.
- At start the worker closes presence a killed run left open
(HistoryStore.close_open_presence), so a person who is gone no longer
hears new speech after a restart.
- run_reply_engine(legacy_memory=False) skips v1's single-user memory (warm
profile, extractor, diary, graph, digest); the v2 brain uses it so another
user's profile or diary never reaches the prompt.
- While a brain reply runs, stdout and stderr are muted (also helper threads
such as the web fetch pool); the worker logs through voice_worker/log.py to
the original stderr.
- Live check: Ollama's /v1 fixes the context at 2,048 tokens and cut the
prompt in earlier runs; with an 8k tag the chat-record question was answered
4 of 4 and nothing reached the output. Noted in llm_contexts and the eval.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- src/jarvis/memory/history.py keeps voice transcripts, Jarvis's answers,
registered chat channel messages (with edits and deletes) and voice channel
presence in one SQLite file. Every read is scoped to the asker: own records
always, chat channels and others' words (only while the asker was in the
same voice channel) behind settings, plus an optional since and off.
- Search is language-agnostic: Unicode words, prefixes keeping 60% of the
word, rarer words weigh more, newer wins ties. 100k records search in
24-61 ms here. context() returns the recent window and the matches cut to a
token budget, matches at most half so chatter cannot push out the record
the question is about.
- run_reply_engine(history=...) puts that context into the system prompt
under "Information shared in previous conversations", fenced as data.
evals/test_history_context_recall.py: with the block qwen2.5:7b answers the
stored day in Korean and English (3 of 3 runs), without it the day is unknown.
- Spec history.spec.md, registry entry in CLAUDE.md, reply.spec.md,
docs/llm_contexts.md, docs/v2/memory.md and roadmap updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A base URL that ends in /v1 now selects the OpenAI-compatible API: chat goes
to /chat/completions and embeddings to /embeddings. The conversion lives in
src/jarvis/llm.py only, so the reply engine and every other caller keep their
Ollama-shaped messages and responses.
- Requests drop private engine keys, send tool-call arguments as JSON strings,
map num_predict to max_tokens and the thinking switch to
chat_template_kwargs.enable_thinking, and leave out num_ctx and keep_alive.
- Responses come back with message.content, tool calls with dict arguments and
an id, and message.thinking from reasoning_content.
- Streaming, the warm-up (one-token chat completion), the intent judge and the
dictation clean-up use the same path. A server without an embedding model
fails open to the text paths.
- Specs and docs/llm_contexts.md describe the transport; roadmap records M3
step 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M0 on Strata caught both v2 models skipping a tool they had been given:
the recommended model made up "24 degrees, sunny" instead of calling the
weather tool, and the fast model said "timer set" without calling the
timer tool (3 of 3 each). qwen2.5:7b does the same through the engine.
- Prompt: TOOL_HONESTY_RULES in the persona (live facts only from a tool
result this turn, actions only claimed after a tool reports success, no
answer text next to a tool call), restated at the end of the system
message by tool_honesty_reminder() with the turn's real tool names.
- Engine: skipped-tool guard. When a native-tool model answers before any
tool has run and the plan names a callable tool as a concrete call, the
answer is dropped and the plan steps are direct-executed, then the model
answers from the results. Only literal, schema-valid steps run (regex
fast path, no LLM repair); otherwise the held-back answer is delivered.
- Planner: the AVAILABLE TOOLS lines now carry argument names
(planner_tool_catalog), so concrete steps use the tool's real keys.
- Eval evals/test_tool_skip_confabulation.py; on qwen2.5:7b, 3 runs each,
available-tool cases went from 0/12 to 9/12 calling the tool.
- M0 kit: tools_fast / tools_recommended stages (run_m0_tools.bat) rerun
tool calling before and after the fix on the real models, loading the
production system_prompt.py and planner.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replies stayed long because the prompt stack gave conflicting length signals:
the persona said "one sentence (two at the very most)" AND told the model to
"state the answer in a sentence, then add a dry observation" (a 2nd sentence),
while voice_style said "two to three sentences maximum". The model followed the
longest. Make all three sources agree on exactly one sentence: the persona's
aside must now fold into the same sentence as a trailing clause (never a 2nd
sentence), voice_style caps at one sentence, and agents/llm.md says 한 문장.
Shorter replies also cut Edge-TTS latency, since synth time scales with text
length. Specs (prompts.spec.md) and docs/llm_contexts.md updated; deterministic
prompt-contract tests added.
Follow-up to the OLLAMA_INTENT_MODEL split: document that the Docker stack runs
intent judging / tool routing / extraction on a small qwen2.5:3b (pulled by
ollama-init) kept separate from the big chat answer model, and that setting
OLLAMA_INTENT_MODEL = OLLAMA_CHAT_MODEL folds them back onto one resident model.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Spoken (TTS) replies are 1-2 sentences, so an unbounded num_predict only
exposes the worst case where the chat model rambles or loops. Add an
ollama_num_predict config (default 512, 0 disables) wired into the reply
loop's chat call on both the native- and text-tool paths. The 512-token
headroom stays well above this app's short tool-call JSON, so capping never
truncates a tool call. This keeps the user's quality model instead of
downgrading it. Configurable in the container via OLLAMA_NUM_PREDICT.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Drop Markdown files into an agents/ folder and their contents are appended to
the main reply LLM's system prompt, so an operator can extend the assistant's
rules/tone without code changes. Files are concatenated in filename order
(use 00-, 10- prefixes to control ordering) and re-read once per turn, so edits
apply on the next reply with no rebuild/restart. Fail-open: a missing, empty,
or unreadable folder yields no instructions and never breaks a reply.
- load_agent_instructions() in system_prompt.py (AGENTS_DIR env, default
/app/agents); reads *.md only, skips blanks, ignores non-dir paths
- engine.py appends it alongside the existing settings-UI llm_instructions,
under the same "Additional instructions from the operator:" framing
- docker-compose.yml bind-mounts ./agents:/app/agents:ro and sets AGENTS_DIR
- agents/example.md.sample starter template (.sample is not loaded)
- tests cover ordering, md-only filtering, blank-skip, env/arg resolution,
and fail-open paths
- README, .env.example, docs/llm_contexts.md updated
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
OAuth cannot be done interactively in the headless container, so the login
must be seeded into the mounted ~/.gemini. Three problems are fixed:
- Mount fragility on the Windows Docker Desktop target: the creds mount
defaulted to ${HOME}/.config/javis/gemini, but ${HOME} is often unset when
compose runs outside a WSL shell, silently mounting the wrong dir. Default is
now the project-local ./docker/gemini-oauth (cross-platform), GEMINI_OAUTH_DIR
still overrides.
- No visibility: when oauth is selected but no login is seeded, the path
silently degraded to DDG/Brave. Added gemini_oauth_ready() + a one-time debug
hint and a startup entrypoint warning (skipped on the browser role, fail-open).
- Seeding guidance: oauth_creds.json is the essential credential (refresh token;
GOOGLE_GENAI_USE_GCA=true forces OAuth), which is what the readiness check and
warning verify; docs recommend copying the whole ~/.gemini for convenience.
Adds docker/gemini-oauth/ seed dir (.gitkeep) with the login files gitignored,
GEMINI_OAUTH_DIR in .env.example, and updates DEPLOY.md, stream_browser_modes.md
and llm_contexts.md. Covered by 3 new tests (10 passed total).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The persona prompt was built from the raw OUTPUT_LANGUAGE env while the
reply-language directive read the settings-web UI value (config JSON), so
changing the language in the settings page was honoured by the directive
but ignored by the persona, leaving them contradicting each other.
Add _resolve_output_language() as the single source of truth (config wins
over env) and feed the same resolved value to both build_system_prompt()
and reply_language_directive(). Update docs/llm_contexts.md to match.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Harden the reply-language lock so qwen2.5:3b reliably stays in the locked
language instead of leaking the query language back in:
- reply_language_directive(): single resolver with clear precedence —
explicit OUTPUT_LANGUAGE lock wins over the Piper/Chatterbox English-only
fallback (this deployment's actual TTS is Korean MeloTTS, so the legacy
English lock was both wrong and contradicting the Korean lock).
- Stronger, override-explicit directive wording, inserted near the FRONT of
the system prompt so a small model gives it primacy over the persona.
- build_system_prompt(output_language=...): rewrite the persona's "in the
user's language" clause to the locked language so the persona stops
fighting the lock.
- docs/llm_contexts.md: document the resolver, precedence, and placement.
Live-verified on the running brain (qwen2.5:3b): Korean voice-style input
and a cold English query both return fully Korean replies with no CJK/Hanja
leak. Tests cover unset/set/agnostic/whitespace + precedence + persona rewrite.
Add an optional OUTPUT_LANGUAGE env var that forces every reply into a
single language. When set, output_language_directive() injects a "respond
only in <language>" instruction (also forbidding other scripts) into the
chat loop's system prompt, next to the existing TTS English-only lock.
Empty (default) keeps the multilingual "reply in the user's language"
behaviour, so upstream is unaffected.
For the Korean-only deployment this also suppresses the occasional trailing
CJK/Hanja fragment qwen2.5:3b leaks on free-form chit-chat.
- system_prompt.py: language-agnostic output_language_directive() helper
- engine.py: read OUTPUT_LANGUAGE, append directive in _build_initial_system_message
- docker-compose.yml + .env.example: document/pass the new var
- docs/llm_contexts.md: note the new gating on the main reply context
- tests: cover unset/set/agnostic/whitespace cases
STREAM_BROWSER becomes the broadcast *capability* master flag; the live
screen-share state (new ToolContext.broadcasting, passed per turn by the bot)
decides the backend:
- master off -> broadcast disabled, always Gemini
- master on + live on -> on-screen Chrome (visible on the stream)
- master on + live off -> Gemini
context.broadcasting is None outside the voice path (evals, text entry, older
bot) and falls back to the master flag, so current behaviour is unchanged.
This is the brain-side foundation; bot-side wiring (bridge passes broadcast
state, auto-broadcast on voice join, voice on/off toggle) follows.
Specs + docs/llm_contexts.md updated. Covered by
tests/test_web_search_broadcast_routing.py.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
yolo auto-approves every tool call, so a real-time search query could in
principle trigger write/shell tools. Default approval mode still auto-runs the
CLI's read-only web search in headless mode but never silently approves
destructive tools. Verified end-to-end: a grounded query returns a current
answer in ~23s with the account OAuth login. Test asserts yolo is absent;
specs and docs/llm_contexts.md updated.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds a GEMINI_AUTH=oauth (default) sub-mode that shells out to the Gemini CLI
using the user's Google-account login instead of an API key. gemini_cli_search()
runs `gemini -p <query> -o json --skip-trust --approval-mode yolo`, strips
GEMINI_API_KEY/GOOGLE_API_KEY and sets GOOGLE_GENAI_USE_GCA=true so the CLI
selects the account OAuth method and fails fast when no login exists. Bounded by
a 30s timeout and fail-open to the DDG/Brave/Wikipedia cascade on any failure
(CLI missing, login expired, quota 429, timeout). GEMINI_AUTH=apikey keeps the
legacy REST path. Specs and docs/llm_contexts.md updated; behaviour covered by
tests/test_realtime_gemini_cli.py.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Completes the two info modes in the Python brain:
- config.py: read STREAM_BROWSER / GEMINI_API_KEY / GEMINI_MODEL from env into
Settings (stream_browser, gemini_api_key, gemini_model). Verified load_settings
reads both modes.
- realtime_search.py: two fail-open backends returning the same fenced
UNTRUSTED-WEB-EXTRACT envelope: browser_search() shells the Node CDP helper to
drive the on-screen Chrome (visible on the broadcast); gemini_search() calls
the Gemini REST API with google_search grounding.
- web_search.run(): routes by mode before the DDG cascade (true->browser,
false->Gemini), falling through to DDG/Brave/Wikipedia on any miss.
- browse_and_play tool: plays a YouTube video on the shared screen (true mode
only); registered in the tool registry.
- specs + docs/llm_contexts.md updated (new Gemini LLM context); CLAUDE.md spec
registry updated.
Verified live against the running Chrome: true-mode webSearch returned real
Google results for "오늘 서울 날씨", browseAndPlay played the IU 밤편지 MV, and
false-mode degrades gracefully on a bad/absent key. A valid GEMINI_API_KEY is
still needed to confirm the real Gemini grounding output.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>