Commit Graph
6 Commits
Author SHA1 Message Date
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone 83368d9946 codex: thread descriptions can be turned off, as titles can (cybercaius)
cybercaius on Discord asked to turn Codex's thread descriptions off.
Titles and predictions had an Off; descriptions only had "as Codex
sends it" or a model.

Codex's settings on the Agents page now offer Off for "Thread
descriptions", worded as the titles' Off ("Off", "no description,
nothing sent", in zh, zh-TW, ja and de too). settings.CodexDescriptions
takes "off", /api/settings/codex-descriptions accepts it, and the
gateway answers a thread_description side turn itself through
sentNowhere, as titles' Off does: a finished response.completed with no
output, nothing sent upstream, and Routing/Usage recording it as
answered by magpie with the reason. Both routes take it (the Codex
backend path and /v1/responses).

Why an empty reply is enough: in ChatGPT.app's app.asar the
thread_description helper reads the reply's {"description"}; with no
message it records an "empty" result, not an error, and the thread's
description is left as it was.

The docs (gateway-routing.md) say each of titles and descriptions has
its own Off and neither turns off the other. No CLI change: titles' Off
isn't settable from the CLI either. docs/reference.md doesn't list
these settings.

Run:
- gofmt -l: nothing. go vet: darwin ./..., GOOS=linux -tags nogui
  ./..., GOOS=windows ./...: ok.
- go test -timeout 45m ./internal/gateway ./internal/gui
  ./internal/settings before the rebase: gui ok, settings ok; gateway
  had TestDisabledCodexModels ("no space left on device") and
  TestHistoryKeepsDaysAndDropsOld red during a moment the disk was
  full; both pass -count=5.
- Rebased on f0ffee34c: TestCodexDescriptions/Titles/Predictions in
  gateway, gui and settings ok; go vet of the three packages ok.
- Whole GUI suite (916 files, both engines, every language,
  --test-concurrency=4, box at load 100 to 200 from other sessions):
  13328 tests, 13144 pass, 184 fail. The 33 red files were run again
  on main 508911e43: the same tests red there (quota-refresh-order
  #3679, routing-* #3408 #3409 #3410 #3411 #3412 #3799 #1612 #2658,
  gateway-caller-keys #3797, menu-input-scroll #3402, key-replace
  #3476, phone-web #3180, old-webkit #3403, header-centre #3479,
  quota-count-wrap #3404, icon-tile #3858 new, provider-detect-draft
  #3859 new, ...). The rest, run again at the rebased head: green
  except s3-sync (#3413), search-first (#3795), usage-agents-hide
  (#3414), usage-fold (#3415), usage-ledger, all red the same on
  f0ffee34c, and library-row-remove 1 of 3 (#3099). codex-descriptions,
  codex-titles, codex-predictions and i18n-keys green at the rebased
  head.

Broken by hand:
- the gateway's off branch removed: gateway TestCodexDescriptionsSetting
  red (magpie knows no model "off", no response.completed);
- the API's "off" check removed: gui TestCodexDescriptionsSetting red
  (400);
- settings validation without "off": gui and gateway tests red (400 /
  "must be a model's id ... not \"off\"");
- the picker's Off option removed: codex-descriptions.test.cjs red in
  chromium and webkit, en and zh.

Not tried: a real Codex app session with descriptions Off; the app's
side is read from its minified code only.
2026-10-27 15:30:31 +08:00
yetone e0b39f7784 codex: titles, descriptions, predictions and memories follow the session's model (cybercaius)
cybercaius on Discord: after v0.1.1576 (a1174674d) Codex's subagents and
memories followed the session's magpie model, but the Codex app's
titles, descriptions and composer predictions, and memory consolidation
before any turn, still went to the ChatGPT sign-in's own models, and the
pickers had no "Same as the session" (跟随当前会话) option.

- Server.codexSessionOf is the session's model when it is one of
  magpie's: the model the conversation's own turns last went on
  (codexLeads: parent thread, own thread, else the key's last), else,
  before any turn came through magpie, Codex's config model
  (agent.CodexSideModel). A model turned off, gone or held from the
  caller's key gives "".
- codexSideTo (titles, descriptions, summaries) and now predictions take
  it when the setting is unset, so a session picked in the app, not
  only in config.toml, keeps them off the ChatGPT allowance. A session on
  Codex's own model leaves them as Codex sent them.
- codexFollowTo (subagents, memories) uses the same reader, so a memory
  consolidation Codex runs at start follows the configured model.
- GUI: the unset option of the titles, descriptions and predictions
  pickers is "Same as the session" now (it is what unset does), and the
  memories row says so; tooltips in en, zh, zh-TW, ja and de.
Zero config: nothing to set; an explicit pick still wins.

Run at the pushed tree (on origin/main 88ac42843), go test -tags nogui
-count=1 -timeout 45m: internal/gateway ok 447s, internal/codexcat ok,
internal/gui ok, internal/agent/... ok; internal/provider crashes in
TestUnreadLoginsWriteErrorsKeepCredentials ("close of synctest channel
from outside bubble" in filememo.Forget), red the same alone on
origin/main 88ac42843, filed as #3632 with a patch there; with that
test skipped internal/provider ok 152s. gofmt -l clean; GOOS=linux go
vet -tags nogui ./... and GOOS=windows go vet ./... clean.
- GUI (playwright 1.62.0, chromium + webkit, en/zh/zh-TW/ja/de):
  codex-titles, codex-descriptions, codex-predictions, codex-memories,
  codex-memories-settings, codex-auto-review, codex-subagent-model,
  codex-subagents-lead, agent-prefs, settings-general, i18n-keys, gui-ja,
  gui-zh-tw, gui-de, search-keys: 189 of 189 pass.
Broken by hand: with codex_follow.go/codex_titles.go/codex_backend.go
reverted, TestCodexAppSideTurnsFollowTheSession,
TestCodexAppSideTurnsStayWithAnOwnModelSession and
TestCodexMemoriesBeforeAnyTurnFollowTheConfig fail; reverting only the
predictions route fails the first one's composer_predictions case.
Not tried: a real Codex app session; the side calls were driven through
the gateway with recorded request shapes in a sandbox HOME.
2026-10-26 17:19:00 +08:00
yetone f1e4516da2 gui: Codex's and Claude Code's own settings are in the agent's row on the Agents page, not in Settings
The owner, 10-20: Settings › General held Codex subagents, Long
conversations, Codex background compaction, thread titles, thread
descriptions, composer predictions, the auto-review model and the
memories model, apart from the agents they set; "很割裂、很分散,不直观".

They now sit with their agent (AGENT_PREFS): in its opened row on the
Agents page (a Settings list in connectPanel), in a sheet from the
tray panel's row ("Settings" line, openAgentPrefs) and from the agent's
menu ("{agent} settings"). Each row is the one element moved between
those places, so its handlers and state go with it. Settings' search
still finds them, with a row that opens the agent's sheet
(#agentPrefLinks). A gateway has no Agents page and none of them.
Strings for zh, zh-TW, ja and de; docs (reference, agent-wiring,
gui-shell) point at the new place. app.js 1,277,298 bytes and the core
scripts 1,469,058, so both budgets rise.

Run on 6416d639c (the dialog morph, on origin/main 75e769a9f), macOS,
playwright 1.62.0:
- agent-prefs.test.cjs (new) plus the 10 migrated files (codex-titles,
  codex-descriptions, codex-auto-review, codex-predictions,
  codex-memories-settings, codex-async-compact, compact-at,
  settings-general, bare-ids, gateway-mode) and modal-morph: 152/152,
  chromium and webkit, every language, wide and 420px.
- go test ./internal/gui/: ok after the budget rise.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.

Two GUI tests leaned on the Agents page's old height and are moved with it:
agent-models-loading clicked "elsewhere" at (900, 650), which is now
Codex's Disconnect button in its opened row, so it clicks the page's lead
line; agent-expand-steady clicked Goose's row while Codex's opened row
(~554px with its settings) pushed it out of a 560px view, so it wheels
Goose's link into sight first (reader.cjs reach). codex-subagents-lead
and agent-models-redraw clicked controls below Codex's opened row and
timed out in WebKit ("outside of the viewport"); they wait for the row to
finish sliding open, then wheel the control into sight. With Settings ›
General shorter, segs-press-redraw's sweep left Usage's warm-up tabs
above the view in WebKit; it wheels them back when they are. panel-effort
opened Kimi's row below Codex's opened one the same way. login-allow's
wheel loop read the shorter General page's button 50ms after each wheel and
clicked beside it (de, 440px); it uses reach. mobile-web shut each agent
picker by tapping the Agents tab, which a picker opened low in Codex's
taller row covers on a phone; it taps the header's name (the lead line
can sit under the header's tabs, and a tap there opened Library), wheels
each row and field into sight before tapping it, and says which agent and
field a step timed out on. All seven pass in Chromium and WebKit.

After the rebase onto main (32 commits on), with the test fixes above:
- go test ./internal/gui/ ./internal/plugin/ ./internal/agent/ ok;
  gofmt -l clean; go vet GOOS=linux -tags nogui and GOOS=windows.
- 95 GUI files (every agent-, codex-, claude-, settings- and modal- file,
  and every file either side changed): 1375 pass; the 8 reds were
  segs-press-redraw, fixed above. The 16 other files that click an
  Agents row: 369/370, rail-tip red on main too (#3091).
- The full suite's reds are listed in the dialog morph's commit; each was
  run alone on this head and on origin/main.
- mobile-web's "desktop matches origin/main" compares Settings and the
  Agents page with main's assets, so it is red until this is on main; its
  phone checks pass in Chromium and WebKit.
2026-10-21 02:06:23 +08:00
yetone 5b8659ec46 gui tests: each wheel lands before the row is looked at again (#2370)
bare-ids (chromium 420 zh-TW, "the click scrolled the page 716 !== 800")
went red under load, and so could its three siblings that wheel a
Settings row to mid-view the same way (codex-auto-review, codex-titles,
codex-descriptions).

Cause, from a logged run under load: each test wheeled 100px, waited
30ms and read the row's place again. On a busy machine the wheel's
scroll hadn't landed in 30ms, so the read was from before it and more
wheels were sent. The view went past the row: #bareIdsSegs sat at
top ~20, under the header (the view starts at ~104). Playwright then
scrolled the control into sight to click it. The app put that scroll
back, as it does any scroll not the reader's (backToReader), and since
the focused button was then out of sight it brought it back with
scrollIntoView({block:"nearest"}), which gave 716. A reader can't click
a control hidden under the header, so the page did nothing wrong. The
test's assumption was the fault.

Fix, in reader.cjs:
- wheeled(): one wheel, then a wait until the view's scrollTop changes.
  It gives up after 1s, when the view is at its end.
- reach() wheels through it in place of its 40ms pause. Three wheels in
  a row that move nothing end it.
- wheelTo(page, locator, y) wheels in 50px steps till the control's top
  is at y, then calls reach so it is clear in sight.
The four tests use wheelTo(…, 200), so the page is still scrolled
before the click, which the test needs to show a move.

Broken by hand: latewheel.cjs, a --require preload, sends each
page.mouse.wheel 80ms late (the call returns at once).
- On origin/main 9d97fd073: bare-ids red in 5 of 10 cases (716 !== 800,
  716 !== 895, 772/781/805 !== 900), codex-titles 2 of 2, codex-auto-review
  1 of 2 (641 !== 600), codex-descriptions 1 of 2.
- With this change: 32 of 32 cases pass, chromium and webkit, with and
  without the injection.
A busy loop in every animation frame (120 or 200ms) also made the old
bare-ids red, 3 of 4 runs.

A first try used reach alone. At 900 the row was already in sight in
zh, zh-TW and ja, so the page wasn't scrolled ("must scroll to the
row"). wheelTo keeps the scroll.

Run at this head, NODE_PATH=playwright 1.62.0:
- the four files, BROWSER=chromium and webkit, both widths, every
  language each test has: all pass.
- every file that uses reach (22) plus click-scroll, at
  --test-concurrency=3: chromium 209/210, webkit 209/210. The two reds
  fail on origin/main as it is:
  - refusal-retries-setting chromium ja 420, "saved again 1 !== 2":
    1 of 6 runs alone on the old code; that is #2258.
  - group-member-weight webkit de 420, 1269 !== 1268: 1 of 4 alone on
    the old code; filed as #2387. With this change it passed 4 of 4
    alone.

Full suite: SUITE_LINE
2026-10-15 23:08:04 +08:00
yetone 9b863817f7 gui: Settings' Codex thread descriptions row says its name alone, as the titles' row does (#1198)
The descriptions row came with a line under its name that changed with the
pick ("Codex asks its own model for each thread's description…" / "Codex's
description requests go to this model…"). f36e744c3 made each setting say
its name alone, its button the choice (1ooogle on X), and the titles row
beside it has no such line, so this one drops it too, with its two strings
in every language.

codex-descriptions.test.cjs (new, after codex-titles) covers the row: the
app's menu rather than a native select, Codex's own by default, a pick
posts settings/codex-descriptions alone with the titles' setting left as
it was, back to Codex's own, no line under the name, no click scrolls the
page; en and zh, Chromium and WebKit.

Run: codex-descriptions, codex-titles, i18n-keys, gui-de, gui-ja,
gui-zh-tw, settings-general, settings-sections, settings-search and
library-mcp-tools, 82/82 in both engines. Broken by hand: a .sub put back
under the name fails the new test (2/2), and the pick posting to
settings/codex-titles fails it (2/2).
2026-10-13 10:13:16 +08:00