Files
plugins/packages/fovea/page
webkubor 2598c5355a fovea 0.2.5: Gemini support, harness blocks are not the user's words, legacy function role (#763)
Gemini requests (`contents`) are now thinned: thought parts, parts carrying a
thoughtSignature and functionCall parts stay as sent; a functionResponse keeps
its id, name and keys while the long strings inside it are cut; old images
become a note; document and video inlineData stay. saccade "auto" strips
<system-reminder> blocks before judging the topic, and a user message that is
only harness blocks is not the newest question. leadingUserEnd counts
custom_tool_call / computer_call / local_shell_call (and outputs) as answers.
Chat's legacy role "function" messages are thinned like role "tool".
page/measure.js carries the same change (diff of the two files is only the
export line).

What was run at 38385b82 (merged onto main 15f4fa80), on mote (macOS, Bun 1.4.2):
- bun test packages/fovea: 57 pass, 0 fail; bun scripts/check.mjs fovea: ok.
- fovea main vs 0.2.5 through magpie's own moejs middleware runner
  (internal/middleware Begin/Request, a throwaway test, not committed):
  - Gemini body, 41 turns, 849,212 -> 360,846 bytes (main: unchanged).
    Every thought part, thoughtSignature text part and functionCall is
    byte-identical; functionResponse ids/names kept, nested strings cut;
    image/png -> note, application/pdf untouched; the task turn and the
    recent window unchanged; no middleware failures.
  - Gemini, 401 turns, 8.5 MB, default options: 3.4 ms in onRequest
    (limit 250 ms).
  - Claude Code shape with <system-reminder> on every tool_result turn,
    saccade auto: a follow-up collapses nothing (main and 0.2.5); a real
    topic change with a reminder attached collapses 57 old items on 0.2.5,
    none on main.
  - Chat role "function": 81,491 -> 25,035 bytes (main: unchanged).
  - Responses whose first answer is custom_tool_call: 81,736 -> 25,240
    (main: unchanged).
- No new network access or I/O in the diff.

Not tried: a real Gemini account through a live gateway.
2026-11-05 21:27:14 +08:00
..