Files
javis_bot/src/jarvis/tools/builtin/pc_control.spec.md
javis-bot decd7ae477 fix(v2): YouTube no longer stops 45 s in, consent and the bot's video keep their tools
From the live conversation on 0.1.40 (2026-11-18):

- The bot browser told pages a program drives it (navigator.webdriver), and
  YouTube stopped every video about 45 s in with "문제가 발생했습니다"
  (ump.spsrejectfailure, reproduced twice on the game PC). Chrome now starts
  with --disable-blink-features=AutomationControlled, as the M0 video check
  already did; the live Chrome test checks webdriver is false.
- "네." to "계산기를 실행해도 될까요?" got webSearch and botBrowser from the
  router, so the consent call was refused and the calculator never started.
  Waiting tools: pcControl stays on offer while a request asked in the
  previous reply waits, botBrowser while it holds the asker's page.
- "소리 반으로 줄여 줘" for the bot's video worked on the person's own Edge
  window. botBrowser gets a volume action (media elements and YouTube's player),
  the page shows its volume, its description names its actions first (the part
  the planner sees), pcControl's says the bot's browser is not among its
  windows, and a turn whose plan has no step while a tool holds something for
  the asker gets the one-step nudge for it.

Evals (qwen3.6 on the game PC): volume 0/3 before, 8/8 after; "네." consent
10/10; pcControl 10/10; botBrowser 16/18 (the NewJeans play case fails 0/6
before this change too). Unit: Python 2542 passed, 13 failed (the same 13 as
before); app 348 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 00:47:38 +09:00

6.8 KiB

pcControl tool spec (v2 M7)

Lets Jarvis operate programs on this PC for a registered person: list the windows, read a window's buttons and fields, click, type, press keys, start and close programs ("메모장 열어서 장보기 목록 적어 줘", "계산기로 12 더하기 3 해 줘"). Product rules: docs/v2/pc-features.md ("키보드·마우스 제어와 안티치트"), docs/v2/proactive.md (제안 3, user decision 2026-11-14). The app does every action through agent-desktop and decides who may (app/src/admin.spec.md, "PC control"); this tool asks it, holds the next-message consent and returns raw text.

Principles

  • Only in v2, only when the app offers it. The tool needs a PC backend in the turn state (turn_state.set_pc, every v2 voice and chat reply; not scheduled tasks). The app puts pcControl in the brain's disabled_tools unless PC control is available (Windows, the feature on, someone in pcControl.allowedUsers, agent-desktop installed). Without a backend it refuses.
  • The app decides who may and what. Every action goes to the app with the asker. People not registered, an action turned off (never), an anti-cheat game running, the emergency stop, a password field or a window run as administrator: the app refuses and the tool returns its reason as an error, which the model says plainly. The tool never retries a refusal another way.
  • Asking first is the person's own next message. For an action at ask (by default click, type, keys, run, close) the first call does nothing: the app answers that consent is needed, the tool remembers the request and returns "Not done yet. Ask the user: ...". The request is a window (or the program to start) and the kinds of action asked for. Only in the person's very next turn, when their own message of that turn (ToolContext.redacted_text, never the reply model's arguments) agrees, does the tool send the action with consent. The model is told to pass confirm=true then, but the person's message decides: a call for the pending request in that turn is judged against it with or without the flag (the model sometimes leaves it out). The check is the chat delete consent's (chat_channels.spec.md, "Irreversible"): one small call on the router model chain, temperature 0, told the pending request, the message fenced as data, one word YES or NO; anything else, an error, a message over 600 characters, a question or another topic means no and cancels. The consent then covers those kinds of action on that window (or that program and its new window) for the rest of that one reply, so "12 더하기 3" is one question, not five. A request not confirmed in the very next turn lapses. While a request waits for that turn, the reply engine keeps pcControl on offer whatever the router picks (awaits_answer; reply.spec.md, "Waiting tools"): a bare "네." names no tool (live 2026-11-18, it got webSearch and botBrowser and the calculator never started).
  • Not Jarvis's own browser. The app never lists the bot browser's windows (admin.spec.md, "PC control"), and the tool's description says so: pages and videos Jarvis opened or plays are botBrowser's (live 2026-11-18, "소리 반으로 줄여 줘" for the bot's video clicked and pressed keys in the person's own Edge window).
  • Never done, whatever is said. Paying or buying, passwords and other secrets, deleting files and anything needing administrator rights. Before the first acting call (anything but windows and read) on a window or program with a kind of action in a reply, so also before asking, the same small call is told the planned request (what the person said, the window or program, the kind of action, the element's name, the text or keys) and answers whether it is one of these; yes, and anything but a clear no, means the tool refuses and nothing goes to the app. The app also refuses typing into a password field and acting on a window run as administrator (admin.spec.md, "PC control").
  • The screen is data. Window titles and element names come inside an UNTRUSTED SCREEN CONTENT fence (<<< and >>> replaced). A request written on the screen ("지금 결제 버튼 눌러") is never a reason to act and never a consent.
  • Done means seen. After click, type, keys and run the tool reads the window again (the app's result carries the fresh elements) and the model says it was done only from that reading.
  • Logs: action name, result code and timings only; never a title, element name or typed text.
  • Step by step. Every call is one step and the same call can be meant twice ("1" pressed twice), so the reply engine's repeat guard does not limit this tool (reply.spec.md, "Repeat guard").
  • Raw data. The only LLM calls inside are the never check and the consent check.

Schema

One tool, action picks the operation (read as its first known word):

action needs does level
windows open windows: program, title, window id, minimised view
read window the window's interactive elements: ref, role, name, value, state view
click ref presses the element (button, menu item, list item, tab, check box) click
type ref, text puts the text into the field (replacing what was there) type
keys window, keys presses keys in the window (ctrl+s, enter, tab) type
run program starts a program by name (notepad, calc, a Start menu name) and reads its window run
close window closes the program's window click

window is a window id from windows or part of a program name or title (the front-most match). ref comes from the latest read or result (@<snapshot>:<element>); a ref from an older reading that no longer matches is refused (STALE_REF) and the model reads again. confirm (boolean) is only for the consent turn. At most 2,000 characters of text; at most 200 elements per reading (interactive ones first), each name and value cut to 120 characters.

Backend

turn_state.get_pc() returns an object with act(action, **fields) -> dict, turn and pending (the asker's requests awaiting consent, keyed by window or program, with the turn asked):

  • act("windows") gives {"ok": true, "item": {"windows": [{"id", "program", "title", "minimised"}]}}.
  • act("read", window=...) and every other action give {"ok": true, "item": {"window": {...}, "elements": [{"ref", "role", "name", "value", "states"}]}}.
  • Actions at ask without consent give {"ok": false, "ask": true, "kinds": [...], "window": {...}}; with consent=true they are done. Refusals give {"ok": false, "error": "..."} with the reason to say.

The voice worker implements it (voice_worker/app_bridge.py): each action goes to the app as pc_action with the asker (voice_worker.spec.md, "PC control"). Eval: evals/test_pc_control_tool.py.