Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
agent: Codex background compaction writes the bare async_compaction = true where a Codex older than 0.163 reads the config (多喝热水)
yetone11848625831c
diff --git a/docs/subsystems/agent-wiring.md b/docs/subsystems/agent-wiring.mdindex c35f3d36b..42271fdfe 100644--- a/docs/subsystems/agent-wiring.md+++ b/docs/subsystems/agent-wiring.md@@ -20,7 +20,7 @@ something else shows up as drift.| What came before | The stash (`stash.json`) remembers what the config said before magpie pointed it at the gateway, so Disconnect restores it rather than guessing. | [`stash.go`](../../internal/agent/stash.go) || Disconnect and preview | `Disconnect` runs `Unwire`, then returns each field still on magpie to its default. Last it runs `Restore`: Pi and its kin (`piLike`: Pi, OmO, Prime Agent; and MothX, its one `settings.json`) copy `settings.json` and `models.json` aside (`*.before-magpie`, `beforeMagpie`) before magpie's first write, and put that copy back byte for byte where what Disconnect left is the same JSON; a file that wasn't there goes again when only empty objects are left in it. `DisconnectPreview` runs the real Disconnect on a copy under a temporary home, in a subprocess (`DryRunArg`), and diffs the files. The preview is never a second account of what Disconnect does. | [`applied.go`](../../internal/agent/applied.go), [`preview.go`](../../internal/agent/preview.go) || Keeping configs current | `Reseat` moves agents off a model magpie no longer serves (#200). `OnGateway` and `Rewire` write the new gateway address into every connected agent when the port changes. `Source` and `Stale` say what an unconnected agent runs on, and whether running copies still use the old list. | [`reseat.go`](../../internal/agent/reseat.go), [`rewire.go`](../../internal/agent/rewire.go), [`connectinfo.go`](../../internal/agent/connectinfo.go) |-| Codex background compaction | Long conversations' Codex background compaction, in Codex's opened row on the Agents page (`CodexAsyncCompact`, `CodexAsyncCompactPercent`, #2490) writes `[features.async_compaction]` `enabled = true` and `model_async_compact_threshold_percent` (Codex 0.163 reads it only in that table) into each Codex config magpie routes, on every `Sync`. Codex starts a background compaction only on a provider whose `capabilities.remote_compaction` is `"v2"`, which it gives OpenAI and Azure alone, so `[model_providers.magpie]` gets `capabilities = { remote_compaction = "v2" }` too, also when the user turned the feature on by hand (#2493); `putProvider` carries the table's capabilities over when it writes it again. What magpie wrote is in the stash under `codex.async`: a value the user set, or changed since, is never written over and stays when the switch goes off; a bare `async_compaction = true`, an inline or dotted table is the user's as written. | [`codex_async.go`](../../internal/agent/codex_async.go) |+| Codex background compaction | Long conversations' Codex background compaction, in Codex's opened row on the Agents page (`CodexAsyncCompact`, `CodexAsyncCompactPercent`, #2490) writes `[features.async_compaction]` `enabled = true` and `model_async_compact_threshold_percent` (Codex 0.163 reads it only in that table) into each Codex config magpie routes, on every `Sync`. The table is written only when every Codex that reads the config is 0.163.0-alpha.8 or later (`codexReaders`: the CLI on PATH, the Mac app's bundled `codex-cli/codex-package.json`, the Windows Store app and an editor's `openai.chatgpt` extension, whose versions aren't known, a WSL distro's CLI): an older Codex takes every unknown `[features]` entry for a bool and won't load a config with the table ("invalid type: map, expected a boolean"). Otherwise, or with no Codex found, magpie writes the bare `[features]` `async_compaction = true`, which every Codex loads, and no threshold; a table magpie wrote before is taken out on the next `Sync`, and Settings' row names the Codex that held it (`CodexAsyncHeld`). Codex starts a background compaction only on a provider whose `capabilities.remote_compaction` is `"v2"`, which it gives OpenAI and Azure alone, so `[model_providers.magpie]` gets `capabilities = { remote_compaction = "v2" }` too, also when the user turned the feature on by hand (#2493); `putProvider` carries the table's capabilities over when it writes it again. What magpie wrote is in the stash under `codex.async`: a value the user set, or changed since, is never written over and stays when the switch goes off; a bare `async_compaction = true` the stash doesn't name as magpie's (`bool`), an inline or dotted table is the user's as written. | [`codex_async.go`](../../internal/agent/codex_async.go) || Named omp profiles | omp keeps a profile's settings under `~/.omp/profiles/<name>` (or under `PI_CONFIG_DIR`), each with its own `config.yml` and `models.yml`. Every such profile is an agent of its own — `omp#<name>` on Windows, `omp#<name>@wsl:<distro>` in a distro — so each can be connected, drifted and disconnected on its own. They share omp's model lists (`ListsFor`), and the default `omp` row is the folder `ompDir`/`ompIn` already pick, so an `OMP_PROFILE` that row is already pointed at is not listed twice. A name omp refuses is not a row: `default`, a trailing dot, or a Windows reserved device name (`aux`, `nul`, `com1`, `lpt9.x`, `con.work`), on every platform (`ompProfileOK`). A distro's profile names come from its probe and are kept in `wsl.json`; a stopped distro is never started to list them, its profile rows showing what was last seen (`asleep`). | [`omp.go`](../../internal/agent/omp.go), [`wsl.go`](../../internal/agent/wsl.go) || WSL twins | On Windows each running distro is probed once, without starting a stopped one. The `wslKinds` agents found there become agents of their own, `<id>@wsl:<distro>`, edited through `\\wsl.localhost\<distro>`. A kind is found by its folder under the distro's home or by its command there (not one on a Windows drive). Where another tool shares one of them, the kind leaves it out: Gemini CLI is found by its command alone, because Antigravity keeps `~/.gemini` too. Goose is found by its folder alone, because a `goose` command can be pressly's migration tool. Reasonix also needs the version its command gives (`accept`), because the old npm client is named `reasonix` too. The gateway address and key follow the distro's networking: mirrored or NAT (`place`, `keyAt`). `ListsFor` keeps a twin's model picks under the Windows twin's id (#927). | [`wsl.go`](../../internal/agent/wsl.go), [`gatewaykey.go`](../../internal/agent/gatewaykey.go) || Settings tuned from use | Usage › Context's "Tuned for you" advises, per agent, the settings that would have spent the fewest tokens on the user's own calls of the range, and puts one in on a click. Package `tune` replays the calls `sessions.Calls` reads from the agents' session files under each candidate value (`Compact`, `CacheTTL`); `tuneOf` picks the agents and models (Claude Code per model, Codex pooled). `TuneRead`, `TuneApply` and `TuneUndo` know where each setting lives: Claude Code's `modelSettings.<model>.autoCompactWindow` (where its `/autocompact` saves), `promptCacheTtl` and `subagentPromptCacheTtl` in `~/.claude/settings.json`; Codex's top-level `model_auto_compact_token_limit`. The advice is weighed by tokens alone: it is labelled "Fewest tokens", and a compaction window it would change says it doesn't measure how well the agent keeps the task after a compaction, and that a lower window compacts more often (#1854, `context-tune.test.cjs`). A compaction row's "Other window…" opens the app menu with every value of the curve, each with its estimated extra tokens over the fewest and about how many compactions it would have made (`Point.compacts`, from the same replay), and puts the one picked in like Use (#1860). An agent whose files time its compactions also has their wait weighed (HirotaNagai on X): Claude Code's `compact_boundary` line says `compactMetadata.durationMs`, which `sessions` puts on the first call after it, and Codex compacts by a call of its own (the record a `compacted` line names, in rollouts since 2026-09), whose time is the compaction's (`Call.Compact`; an older rollout's compaction has no call and stays untimed). With 3 or more timed for a model (`minTimed`), `Facts.took` is their median seconds, each window says its wait (`Point.wait`, its compactions × `took`), and the row says what a compaction took, the wait at the advice against the window now, and the cheaper window the advice passed over for waiting longer (`Compaction.cheapest`, `wait_cheapest`) when it saves 3% or more; the advice is labelled "Tokens + wait", its caveat says tokens and waiting only, and the picker says each window's wait with "Fewest tokens" on the cheapest (`context-tune.test.cjs`). An agent or model with fewer timed reads and is advised as before. | [`internal/tune`](../../internal/tune/tune.go), [`tune.go`](../../internal/agent/tune.go), [`internal/gui/tune.go`](../../internal/gui/tune.go) |diff --git a/internal/agent/codex.go b/internal/agent/codex.goindex 151cb9399..0819bee4a 100644--- a/internal/agent/codex.go+++ b/internal/agent/codex.go@@ -432,7 +432,8 @@ func codexIn(at place) *Agent {// where Codex is routed through magpie, taken back where it isn'tasyncCompaction := func(routed bool) error {s := settings.Load()- return codexAsyncSync(path, at.key("codex.async"), routed, s.CodexAsyncCompact, s.CodexAsyncCompactPercent)+ on := s.CodexAsyncCompact && routed+ return codexAsyncSync(path, at.key("codex.async"), routed, s.CodexAsyncCompact, s.CodexAsyncCompactPercent, on && codexAsyncTableOK(at))}// keptBearerToken is the table's bearer token when it is one the// gateway takes: a caller key of the gateway's own the user put indiff --git a/internal/agent/codex_async.go b/internal/agent/codex_async.goindex e4092467d..dc1d095ba 100644--- a/internal/agent/codex_async.go+++ b/internal/agent/codex_async.go@@ -14,10 +14,27 @@ package agent// What magpie writes is kept in the stash, so a value the user set there// (by hand, or a value they changed since) is theirs: never written over,// and left when the setting is turned off.+//+// The table form is read only from Codex 0.163.0-alpha.8 on. Before it,+// every [features] entry Codex doesn't know is a bool, and a table there+// stops Codex from loading its config at all ("invalid type: map, expected+// a boolean": 0.162.1's FeaturesToml, and the Codex app on Windows of+// 多喝热水 on Discord, which wouldn't open). The bare async_compaction =+// true every Codex reads: an older one ignores it, a newer one turns the+// feature on at its own 65%. So the table, which the threshold needs, is+// written only when every Codex that reads this config is known to be new+// enough (codexReaders), and the bare key otherwise; a table magpie wrote+// before is taken back out where it no longer is.import ("encoding/json""errors"+ "os"+ "path/filepath"+ "regexp"+ "runtime"+ "strings"+ "sync""github.com/pelletier/go-toml/v2"@@ -27,13 +44,121 @@ import (const (codexAsyncTable = "features.async_compaction"codexAsyncPercent = "model_async_compact_threshold_percent"+ // codexAsyncTableFrom is the first Codex whose [features] takes+ // async_compaction as a table (FeatureToml<AsyncCompactionConfigToml>+ // in codex-rs/features, rust-v0.163.0-alpha.8; alpha.5 has none)+ codexAsyncTableFrom = "0.163.0-alpha.8")+// CodexReader is a Codex that reads a config: what it is ("cli", "app",+// "ide", "wsl") and its version, "" when that isn't known.+type CodexReader struct {+ Kind string `json:"kind"`+ Version string `json:"version,omitempty"`+}++// codexReaders are the Codexes that read the config at at: the CLI on+// PATH, the desktop app's own (its bundled codex-cli on a Mac; the Store+// app's on Windows, whose version magpie can't read), the editor+// extension's, or a WSL distro's CLI. A var so tests can name them.+var codexReaders = func(at place) []CodexReader {+ if at.spell != nil {+ return []CodexReader{{Kind: "wsl", Version: at.version}}+ }+ var out []CodexReader+ if bin, _ := (&Agent{ID: "codex", Bin: "codex"}).cliBin(); bin != "" {+ real, _ := throughShim(bin)+ out = append(out, CodexReader{Kind: "cli", Version: installedVersion(real)})+ }+ app := desktopApps["codex"]+ switch runtime.GOOS {+ case "darwin":+ for _, bundle := range macBundles(app) {+ if v, ok := bundledCodexVersion(bundle, app.id); ok {+ out = append(out, CodexReader{Kind: "app", Version: v})+ }+ }+ case "windows":+ if storeAppVersion(windowsStorePackages(), app.store, app.publisher) != "" {+ out = append(out, CodexReader{Kind: "app"})+ }+ }+ if extensionHere(at.home, "openai.chatgpt") {+ out = append(out, CodexReader{Kind: "ide"})+ }+ return out+}++var codexPackageVersionRe = regexp.MustCompile(`"version"\s*:\s*"([^"]+)"`)++// bundledCodexVersion is the version of the codex a Codex app bundle+// ships (Contents/Resources/codex-cli/codex-package.json, "version":+// "0.163.0-alpha.10.2" in ChatGPT.app 26.1013); ok is false for a bundle+// that is no Codex app, "" for one whose version can't be read.+func bundledCodexVersion(bundle, id string) (v string, ok bool) {+ if b, err := os.ReadFile(filepath.Join(bundle, "Contents", "Resources", "codex-cli", "codex-package.json")); err == nil {+ if m := codexPackageVersionRe.FindSubmatch(b); m != nil {+ return strings.TrimSpace(string(m[1])), true+ }+ return "", true+ }+ b, err := os.ReadFile(filepath.Join(bundle, "Contents", "Info.plist"))+ if err != nil {+ return "", false+ }+ m := plistIDRe.FindSubmatch(b)+ return "", m != nil && strings.TrimSpace(string(m[1])) == id+}++// codexAsyncBlocked are the readers that keep the table out: one older+// than codexAsyncTableFrom, or of no known version. None at all is+// unknown as well: a Codex magpie can't see may read the config.+func codexAsyncBlocked(rs []CodexReader) []CodexReader {+ if len(rs) == 0 {+ return []CodexReader{{Kind: "cli"}}+ }+ var out []CodexReader+ for _, r := range rs {+ if r.Version == "" || Newer(codexAsyncTableFrom, r.Version) {+ out = append(out, r)+ }+ }+ return out+}++// codexAsyncHeld is what kept the table out of this machine's config at+// its last sync, for Settings' row to say; nil when nothing did.+var codexAsyncHeld struct {+ sync.Mutex+ rs []CodexReader+}++// CodexAsyncHeld is the Codexes here that kept the background+// compaction's table, and with it its threshold, out at the last sync:+// one too old for the feature, or one whose version isn't known.+func CodexAsyncHeld() []CodexReader {+ codexAsyncHeld.Lock()+ defer codexAsyncHeld.Unlock()+ return codexAsyncHeld.rs+}++// codexAsyncTableOK says whether the table may be written at at.+func codexAsyncTableOK(at place) bool {+ held := codexAsyncBlocked(codexReaders(at))+ if at.spell == nil {+ codexAsyncHeld.Lock()+ codexAsyncHeld.rs = held+ codexAsyncHeld.Unlock()+ }+ return len(held) == 0+}+// codexAsyncStash is what magpie wrote.type codexAsyncStash struct {Enabled bool `json:"enabled,omitempty"` // enabled = truePercent int `json:"percent,omitempty"` // the thresholdCap bool `json:"cap,omitempty"` // capabilities = { remote_compaction = "v2" }+ Bool bool `json:"bool,omitempty"` // [features] async_compaction = true}// codexAsyncNow is how the config has them: the async_compaction value@@ -55,10 +180,13 @@ func codexAsyncNow(path string) (feature any, provider map[string]any, err error// codexAsyncSync puts the setting into the Codex config at path, where// Codex is routed through magpie or not: on is the setting, percent its-// threshold (0 leaves Codex's own). key is the stash's. The capability is-// written for a feature the user turned on in the config themselves too:-// on magpie's provider it would never run without it (#2493).-func codexAsyncSync(path, key string, routed, on bool, percent int) error {+// threshold (0 leaves Codex's own). key is the stash's. tableOK: every+// Codex reading the config takes the table (codexAsyncTableOK); without+// it the bare key is written, and a table of magpie's taken out. The+// capability is written for a feature the user turned on in the config+// themselves too: on magpie's provider it would never run without it+// (#2493).+func codexAsyncSync(path, key string, routed, on bool, percent int, tableOK bool) error {feature, provider, err := codexAsyncNow(path)var bad *toml.DecodeErrorif errors.As(err, &bad) {@@ -73,10 +201,26 @@ func codexAsyncSync(path, key string, routed, on bool, percent int) error {}was := stwant := routed && on- if !want {+ useTable := want && tableOK+ if !useTable {percent = 0}+ // the bare async_compaction = true magpie wrote, where the table is+ // to go instead or nothing is: still as written, it goes; changed, it+ // is the user's+ if st.Bool && (!want || useTable) {+ if feature == true {+ if err := edit.DelTOMLKey(path, "features", "async_compaction"); err != nil {+ return err+ }+ if feature, _, err = codexAsyncNow(path); err != nil {+ return err+ }+ }+ st.Bool = false+ }+// [features.async_compaction]: written only as that table, which a// config without the feature, or with the table, has. The bare// async_compaction = true, or the table spelled inline or as dotted@@ -96,12 +240,15 @@ func codexAsyncSync(path, key string, routed, on bool, percent int) error {st.Enabled = false // set, or changed since, by the user}switch {- case want && !hasEnabled && table["enabled"] == nil:+ case useTable && !hasEnabled && table["enabled"] == nil:if err := edit.SetTOMLKey(path, codexAsyncTable, "enabled", true); err != nil {return err}st.Enabled = true- case !want && st.Enabled:+ case !useTable && st.Enabled:+ // off, or a Codex here too old for the table: the table magpie+ // wrote goes (a table left with nothing of the user's goes+ // whole, so an old Codex loads its config again)if err := edit.DelTOMLKey(path, codexAsyncTable, "enabled"); err != nil {return err}@@ -129,6 +276,21 @@ func codexAsyncSync(path, key string, routed, on bool, percent int) error {st.Enabled, st.Percent = false, 0}+ // the bare key, where a Codex here can't take the table: every Codex+ // reads it, and only one new enough acts on it+ if feature, _, err = codexAsyncNow(path); err != nil {+ return err+ }+ switch {+ case want && !useTable && feature == nil:+ if err := edit.SetTOMLKey(path, "features", "async_compaction", true); err != nil {+ return err+ }+ st.Bool = true+ case st.Bool && feature != true:+ st.Bool = false // changed since by the user+ }+// capabilities on magpie's provider table, when there is one: one the// user gave it, whatever it says, stays as it isif feature, _, err = codexAsyncNow(path); err != nil {diff --git a/internal/agent/codex_async_test.go b/internal/agent/codex_async_test.goindex 0d39f84c2..1e3d5e69c 100644--- a/internal/agent/codex_async_test.go+++ b/internal/agent/codex_async_test.go@@ -1,6 +1,9 @@package agentimport (+ "os"+ "os/exec"+ "path/filepath""strings""testing"@@ -29,6 +32,21 @@ func setAsyncCompact(t *testing.T, on bool, percent int) {}}+// codexReadersAre has the Codexes reading every config be a CLI of each+// version given, put back when the test ends.+func codexReadersAre(t *testing.T, versions ...string) {+ t.Helper()+ was := codexReaders+ t.Cleanup(func() { codexReaders = was })+ codexReaders = func(place) []CodexReader {+ var out []CodexReader+ for _, v := range versions {+ out = append(out, CodexReader{Kind: "cli", Version: v})+ }+ return out+ }+}+// asyncOf is the config's async_compaction value and the capability on// magpie's provider table.func asyncOf(t *testing.T, config string) (feature any, capability any) {@@ -54,6 +72,7 @@ func asyncOf(t *testing.T, config string) (feature any, capability any) {// the switch off takes all of it out again.func TestCodexAsyncCompactionWritten(t *testing.T) {quietCodex(t, false, provider.CodexDaemonCheck{})+ codexReadersAre(t, "0.164.0", "0.163.0-alpha.10.2")home, read := codexHome(t, "", "model = \"gpt-5.5\"\n")setAsyncCompact(t, true, 70)cx := codex(home)@@ -118,6 +137,7 @@ func TestCodexAsyncCompactionKeepsTheUsers(t *testing.T) {} {t.Run(tc.name, func(t *testing.T) {quietCodex(t, false, provider.CodexDaemonCheck{})+ codexReadersAre(t, "0.164.0")home, read := codexHome(t, "", "model = \"gpt-5.5\"\n\n"+tc.config)setAsyncCompact(t, tc.on, 70)cx := codex(home)@@ -165,3 +185,181 @@ func TestCodexAsyncCompactionKeepsUsersCapability(t *testing.T) {t.Fatalf("the user's capability went:\n%s", read())}}++// A Codex older than 0.163.0-alpha.8 takes every [features] entry it+// doesn't know for a bool, and a [features.async_compaction] table stops+// it loading its config ("invalid type: map, expected a boolean", the+// Codex app on Windows of 多喝热水 on Discord, which wouldn't open). Where+// one reads the config, or one of no known version does, or none is+// found, the switch writes the bare async_compaction = true every Codex+// reads, and no threshold.+func TestCodexAsyncCompactionOldCodexGetsTheBareKey(t *testing.T) {+ for _, tc := range []struct {+ name string+ versions []string+ }{+ {"0.162.1", []string{"0.162.1"}},+ {"alpha.5 beside a new one", []string{"0.164.0", "0.163.0-alpha.5"}},+ {"a version not known", []string{"0.164.0", ""}},+ {"none found", nil},+ } {+ t.Run(tc.name, func(t *testing.T) {+ quietCodex(t, false, provider.CodexDaemonCheck{})+ codexReadersAre(t, tc.versions...)+ home, read := codexHome(t, "", "model = \"gpt-5.5\"\n")+ setAsyncCompact(t, true, 70)+ cx := codex(home)+ route(t, cx, read)+ feature, capability := asyncOf(t, read())+ if feature != true || strings.Contains(read(), "[features.async_compaction]") || strings.Contains(read(), "= 70") {+ t.Fatalf("async_compaction = %v, want the bare true:\n%s", feature, read())+ }+ if capability != "v2" {+ t.Fatalf("no remote_compaction = \"v2\":\n%s", read())+ }+ setAsyncCompact(t, false, 70)+ if err := cx.Sync(); err != nil {+ t.Fatal(err)+ }+ if feature, capability := asyncOf(t, read()); feature != nil || capability != nil {+ t.Fatalf("left behind with the switch off: %v %v\n%s", feature, capability, read())+ }+ if _, ok := stashLoad()["codex.async"]; ok {+ t.Fatal("the stash still claims what magpie wrote")+ }+ })+ }+}++// A config an earlier magpie broke for an old Codex — the table it wrote+// with every Codex taken to read it — is mended on the next sync: magpie's+// table goes, whole, and the bare key takes its place. Once every Codex+// is new enough again, the table comes back.+func TestCodexAsyncCompactionTableTakenBackForOldCodex(t *testing.T) {+ quietCodex(t, false, provider.CodexDaemonCheck{})+ codexReadersAre(t, "0.164.0")+ home, read := codexHome(t, "", "model = \"gpt-5.5\"\n")+ setAsyncCompact(t, true, 70)+ cx := codex(home)+ route(t, cx, read)+ if !strings.Contains(read(), "[features.async_compaction]") {+ t.Fatalf("no table with every Codex new:\n%s", read())+ }+ codexReadersAre(t, "0.164.0", "0.162.1")+ if err := cx.Sync(); err != nil {+ t.Fatal(err)+ }+ if feature, _ := asyncOf(t, read()); feature != true || strings.Contains(read(), "[features.async_compaction]") || strings.Contains(read(), "model_async_compact_threshold_percent") {+ t.Fatalf("magpie's table not mended to the bare key: %v\n%s", feature, read())+ }+ codexReadersAre(t, "0.164.0")+ if err := cx.Sync(); err != nil {+ t.Fatal(err)+ }+ feature, _ := asyncOf(t, read())+ if table, _ := feature.(map[string]any); table["enabled"] != true || table["model_async_compact_threshold_percent"] != int64(70) || strings.Contains(read(), "async_compaction = true") {+ t.Fatalf("the table didn't come back: %v\n%s", feature, read())+ }+}++// A table the user wrote is theirs, an old Codex reading it or not.+func TestCodexAsyncCompactionUsersTableStaysForOldCodex(t *testing.T) {+ quietCodex(t, false, provider.CodexDaemonCheck{})+ codexReadersAre(t, "0.162.1")+ users := "[features.async_compaction]\nenabled = true\nmodel_async_compact_threshold_percent = 50\n"+ home, read := codexHome(t, "", "model = \"gpt-5.5\"\n\n"+users)+ setAsyncCompact(t, true, 70)+ cx := codex(home)+ route(t, cx, read)+ if !strings.Contains(read(), users) || strings.Contains(read(), "async_compaction = true") {+ t.Fatalf("the user's table was changed:\n%s", read())+ }+}++// The versions that take the table: 0.163.0-alpha.8 on.+func TestCodexAsyncBlocked(t *testing.T) {+ for v, blocked := range map[string]bool{+ "0.160.0": true, "0.162.1": true, "0.163.0-alpha.5": true, "": true,+ "0.163.0-alpha.8": false, "0.163.0-alpha.10.2": false, "0.163.0": false, "0.164.0": false,+ } {+ if got := len(codexAsyncBlocked([]CodexReader{{Kind: "cli", Version: v}})) > 0; got != blocked {+ t.Errorf("%q blocked = %v, want %v", v, got, blocked)+ }+ }+ if len(codexAsyncBlocked(nil)) == 0 {+ t.Error("no Codex found counts as one that takes the table")+ }+}++// The Codex app's own codex is read from its bundle's codex-package.json+// (ChatGPT.app 26.1013 ships 0.163.0-alpha.10.2); a Codex app without one+// is of no known version, and the ChatGPT chat app is no Codex.+func TestBundledCodexVersion(t *testing.T) {+ dir := t.TempDir()+ app := filepath.Join(dir, "ChatGPT.app")+ writeFile(t, filepath.Join(app, "Contents", "Resources", "codex-cli", "codex-package.json"), `{+ "layoutVersion": 1,+ "version": "0.163.0-alpha.10.2",+ "target": "aarch64-apple-darwin"+}`)+ if v, ok := bundledCodexVersion(app, "com.openai.codex"); !ok || v != "0.163.0-alpha.10.2" {+ t.Fatalf("got %q %v", v, ok)+ }+ plist := func(id string) string {+ return "<plist><dict><key>CFBundleIdentifier</key><string>" + id + "</string></dict></plist>"+ }+ codexApp := filepath.Join(dir, "Codex.app")+ writeFile(t, filepath.Join(codexApp, "Contents", "Info.plist"), plist("com.openai.codex"))+ if v, ok := bundledCodexVersion(codexApp, "com.openai.codex"); !ok || v != "" {+ t.Fatalf("a Codex app with no codex-package.json: %q %v", v, ok)+ }+ chat := filepath.Join(dir, "Chat", "ChatGPT.app")+ writeFile(t, filepath.Join(chat, "Contents", "Info.plist"), plist("com.openai.chat"))+ if _, ok := bundledCodexVersion(chat, "com.openai.codex"); ok {+ t.Fatal("the chat app taken for a Codex")+ }+}++// What magpie writes is loaded by real Codex binaries, old and new: each+// path in MAGPIE_TEST_CODEX_BINS (separated by the system's list+// separator) runs `codex features list` against the config a sync wrote+// for it, in a CODEX_HOME of the test's own. Skipped without it: a test+// fetches no binary.+func TestCodexAsyncConfigLoadsInRealCodex(t *testing.T) {+ bins := filepath.SplitList(os.Getenv("MAGPIE_TEST_CODEX_BINS"))+ if len(bins) == 0 {+ t.Skip("MAGPIE_TEST_CODEX_BINS names no codex binaries")+ }+ for _, bin := range bins {+ out, err := exec.Command(bin, "--version").Output()+ if err != nil {+ t.Fatalf("%s --version: %v", bin, err)+ }+ version := parseVersion(string(out))+ t.Run(version, func(t *testing.T) {+ quietCodex(t, false, provider.CodexDaemonCheck{})+ codexReadersAre(t, version)+ home, read := codexHome(t, "", "model = \"gpt-5.5\"\n")+ setAsyncCompact(t, true, 70)+ cx := codex(home)+ route(t, cx, read)+ codexHomeDir := filepath.Dir(cx.Path)+ cmd := exec.Command(bin, "features", "list")+ cmd.Env = append(os.Environ(), "CODEX_HOME="+codexHomeDir, "HOME="+home)+ cmd.Stdin = nil+ got, err := cmd.CombinedOutput()+ if err != nil {+ t.Fatalf("codex %s can't load the config: %v\n%s\n%s", version, err, got, read())+ }+ on := false+ for _, line := range strings.Split(string(got), "\n") {+ if f := strings.Fields(line); len(f) > 0 && f[0] == "async_compaction" {+ on = f[len(f)-1] == "true"+ }+ }+ if !Newer(codexAsyncTableFrom, version) && !on {+ t.Fatalf("codex %s loaded it with async_compaction off:\n%s\n%s", version, got, read())+ }+ })+ }+}diff --git a/internal/gui/api.go b/internal/gui/api.goindex b85d25250..b01c57525 100644--- a/internal/gui/api.go+++ b/internal/gui/api.go@@ -469,6 +469,10 @@ type settingsJSON struct {// the ChatGPT accounts signed in, each of which can have a daily// warm-up time of its own (#957)CodexUsers []string `json:"codexUsers,omitempty"`+ // the Codexes here that kept the background compaction's table (and+ // its share) out of the config at the last sync: too old for it+ // (before 0.163.0-alpha.8), or of no known version (codex_async.go)+ CodexAsyncHeld []agent.CodexReader `json:"codexAsyncHeld,omitempty"`// whether a WorkBuddy (China) account is signed in, and each one's// last daily check-inWorkBuddy bool `json:"workbuddy"`@@ -640,6 +644,7 @@ func settingsState() settingsJSON {}s.CodexWarmed, s.ClaudeWarmed = latest(provider.CodexWarmed()), latest(provider.ClaudeWarmed())s.CodexUsers = codexUsers()+ s.CodexAsyncHeld = agent.CodexAsyncHeld()s.WorkBuddy, s.WorkBuddyCheckins = provider.HasWorkBuddy(), provider.WorkBuddyCheckins()s.Trae, s.TraeCheckins = provider.HasTrae(), provider.TraeCheckins()s.MiniMax, s.MiniMaxCheckins = provider.HasMiniMax(), provider.MiniMaxCheckins()diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.jsindex 9d3fab0f1..36fdd3705 100644--- a/internal/gui/assets/app.js+++ b/internal/gui/assets/app.js@@ -20956,7 +20956,11 @@ function renderAgentPrefs() {};const asyncRow = el("div", "compact-at");asyncRow.append(asyncSegs, asyncNum);- $("#codexAsyncSegs").replaceChildren(asyncRow);+ // a Codex here before 0.163, or of no known version (codexAsyncHeld)+ const held = s.codexAsyncCompact && s.codexAsyncHeld || [], box = el("div");+ box.append(asyncRow);+ if (held.length) box.append(el("div", "hint codex-async-held", t("{who}: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%", { who: held.map((r) => t({ app: "Codex app", ide: "Codex editor extension", wsl: "Codex in WSL" }[r.kind] || "Codex CLI") + (r.version ? " " + r.version : "")).join(", ") })));+ $("#codexAsyncSegs").replaceChildren(box);renderCodexTitles(s);renderCodexDescriptions(s);renderCodexPredictions(s);diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.jsindex cfd3be2f8..aecd925ed 100644--- a/internal/gui/assets/i18n.js+++ b/internal/gui/assets/i18n.js@@ -1038,6 +1038,10 @@ const I18N = {"Codex 0.163 and later summarise while a turn goes on, past the share of the window typed (65% when empty); a value set in its own config stays": "Codex 0.163 起在一轮进行中就在后台总结,超过这里填的窗口占比时开始(留空为 65%);它配置里自己设的值不动","Background compaction at": "后台压缩阈值","Background compaction at: {v} is not a percent from 1 to 100": "后台压缩阈值:{v} 不是 1 到 100 的百分比",+ "{who}: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%": "{who}:阈值需要 Codex 0.163 或更新;更新之前 magpie 只写 async_compaction = true,按 65%",+ "Codex app": "Codex 应用",+ "Codex editor extension": "编辑器里的 Codex 扩展",+ "Codex in WSL": "WSL 里的 Codex","Codex and Claude Code compact at 272K (non-Claude [1m] too) or the size typed; full window: slower, costlier": "Codex 和 Claude Code 在 272K(非 Claude 的 [1m] 模型也是)或这里填的大小时压缩;完整窗口每轮更慢更贵","Compact at {n}": "{n} 时压缩","Codex thread titles": "Codex 会话标题",@@ -4967,6 +4971,10 @@ const I18N = {"Codex 0.163 and later summarise while a turn goes on, past the share of the window typed (65% when empty); a value set in its own config stays": "Codex 0.163 起在一輪進行中就在背景總結,超過這裡填的視窗占比時開始(留空為 65%);它設定裡自己設的值不動","Background compaction at": "背景壓縮閾值","Background compaction at: {v} is not a percent from 1 to 100": "背景壓縮閾值:{v} 不是 1 到 100 的百分比",+ "{who}: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%": "{who}:閾值需要 Codex 0.163 或更新;更新之前 magpie 只寫 async_compaction = true,按 65%",+ "Codex app": "Codex 應用程式",+ "Codex editor extension": "編輯器裡的 Codex 擴充功能",+ "Codex in WSL": "WSL 裡的 Codex","Codex and Claude Code compact at 272K (non-Claude [1m] too) or the size typed; full window: slower, costlier": "Codex 和 Claude Code 在 272K(非 Claude 的 [1m] 模型也是)或這裡填的大小時壓縮;完整視窗每輪更慢更貴","Compact at {n}": "{n} 時壓縮","Codex thread titles": "Codex 會話標題",@@ -8858,6 +8866,10 @@ const I18N = {"Codex 0.163 and later summarise while a turn goes on, past the share of the window typed (65% when empty); a value set in its own config stays": "Codex 0.163 以降はターンの途中で要約し、入力したウィンドウの割合を超えると始まる(空欄で 65%)。設定ファイルで自分で設定した値はそのまま","Background compaction at": "バックグラウンド圧縮のしきい値","Background compaction at: {v} is not a percent from 1 to 100": "バックグラウンド圧縮のしきい値:{v} は 1〜100 のパーセントではありません",+ "{who}: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%": "{who}:しきい値には Codex 0.163 以降が必要です。更新するまで magpie は async_compaction = true だけを書き、65% で圧縮します",+ "Codex app": "Codex アプリ",+ "Codex editor extension": "エディタの Codex 拡張機能",+ "Codex in WSL": "WSL の Codex","Codex and Claude Code compact at 272K (non-Claude [1m] too) or the size typed; full window: slower, costlier": "Codex と Claude Code は 272K(Claude 以外の [1m] モデルも)か入力したサイズで圧縮。ウィンドウ全体は遅く高価","Compact at {n}": "{n} で圧縮","Codex thread titles": "Codex のスレッドタイトル",@@ -12783,6 +12795,10 @@ const I18N = {"Codex 0.163 and later summarise while a turn goes on, past the share of the window typed (65% when empty); a value set in its own config stays": "Codex ab 0.163 fasst während eines Zugs zusammen, ab dem eingegebenen Anteil des Fensters (leer: 65 %); ein in seiner Konfiguration gesetzter Wert bleibt","Background compaction at": "Hintergrundkomprimierung ab","Background compaction at: {v} is not a percent from 1 to 100": "Hintergrundkomprimierung ab: {v} ist kein Prozentwert von 1 bis 100",+ "{who}: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%": "{who}: Die Schwelle braucht Codex 0.163 oder neuer; bis zum Update schreibt magpie nur async_compaction = true, bei 65 %",+ "Codex app": "Codex-App",+ "Codex editor extension": "Codex-Erweiterung im Editor",+ "Codex in WSL": "Codex in WSL","Codex and Claude Code compact at 272K (non-Claude [1m] too) or the size typed; full window: slower, costlier": "Codex/Claude Code komprimieren bei 272K (auch [1m] außer Claude) oder hier; volles Fenster: teurer","Compact at {n}": "Bei {n} komprimieren","Codex thread titles": "Codex-Thread-Titel",diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.goindex d28e3317c..c905af801 100644--- a/internal/gui/core_budget_test.go+++ b/internal/gui/core_budget_test.go@@ -15,8 +15,8 @@ import (// so a page can't quietly grow back into the core; a change that needs more// raises them and says why in its commit.const (- appScriptBudget = 1_317_486 // app.js: 1,198,239 after Usage left (P2); 1,218,098 with the 10-15 fixes to pages still in the core; 1,232,466 with the provider editor's Advanced fold and every dialog holding its place, the core's own (10-16); 1,250,533 with the quota refresh kept through redraws, the core's own since the tray panel draws it too, plus 1.5% (#2397); 1,269,083 with Free first's option in the provider editor's ROUTINGS, which the Routing page reads too, plus 1.5%; 1,272,726 with the Providers page drawing its last list at once (#1519), the core's page, and the Routing trace's account names read without Object.entries (#1481), plus 1.5%; a dialog growing out of the row that opened it and folding back into it, the core's own since every page's dialogs open through it (10-20); Codex's and Claude Code's own settings moved from Settings into the agent's row on the Agents page, the core's own since the tray panel and the window both draw them (10-20); 1,314,432 with Settings › Privacy's record of what was masked (its summary, the records view and the local model's controls), which belongs to Settings, the core's own, plus 1.5%; 1,336,481 with a provider's Names & levels saying Provider in model names is Settings' and opening it there (joe), and Settings' Image recognition saying where a custom provider's model is marked (nexnull), both in the core's own pages, with no room added (10-23); 1,337,633 with Settings › Models › Replies' Intent classifier timeout (#2934, reyoung), Settings' own row, drawn by waitRow, which the Image generation timeout's row now shares, with no room added; 1,337,735 with the provider editor's link naming a partner's page by its own host (siteHost) instead of usemagpie.ai's /go link, the core's own editor, with no room added (10-23); 1,338,084 with Check in now saying what the press came to (claimed +credits, already today, not available yet) where it said "refreshed" (#3326), the check-in row the tray panel draws too, the core's own, with no room added (10-23); 1,338,929 with a new partner's tile keeping a small dot until it is opened, in the add sheet, the core's own, with no room added (10-23); 1,343,324 with the sidebar's open-page row marked by one shape that moves on a spring (navTopGo), the window's own shell, which every page sits beside, with no room added (10-23); 1,343,465 with a dialog kept centred while its content comes in, until it is pressed (holdModal, every page's dialogs), the core's own, with no room added (10-24); 1,317,486 with what masking did moved out to Insights › Masking (plugins/redact), the budget lowered to it (10-24)- coreScriptBudget = 1_524_789 // every core script: 1,358,034 after Usage left; 1,380,003 with them; 1,405,937 with the fold; 1,426,102 with 10-16's core work (the GitHub list loading, the move to plugins, Settings › Long conversations), plus 1.5% (#2612); 1,447,368 with loadBack, the window's one state read per return, which every page needs and so is the core's own (1,446,845 before it, 155 bytes under), plus 1.5%; OpenCode Zen's card saying OpenCode tells no key its balance adds ~390 bytes inside it; 1,472,589 with the dialog that grows out of its row and the agents' own settings in their rows, on main's 10-20 core work (the Providers page's last list, the Routing trace's names), plus 1.5% (10-20); 1,506,192 with Settings › Privacy's record of what was masked, plus 1.5%; 1,529,393 with the Intent classifier timeout row (#2934), with no room added; 1,529,495 with the editor's partner link host, with no room added; 1,529,844 with Check in now's press summary (#3326), with no room added; 1,530,689 with the new partner tile's dot, with no room added; 1,535,084 with the sidebar's spring, with no room added; 1,549,478 with the context window card's map (tiles by tokens, the default look, the block grid a switch away) and its text view showing an inline image, in context.js, which the Routing page draws as well as Usage, so the core's own, with no room added (10-24); 1,550,768 with a usage card's refresh opening after its text (#840's card, which the tray panel draws too), the Add key spinner, and a dialog kept centred while its content comes in, with no room added (10-24); 1,524,789 with what masking did moved out to Insights › Masking, lowered to it+ appScriptBudget = 1_317_876 // app.js: 1,198,239 after Usage left (P2); 1,218,098 with the 10-15 fixes to pages still in the core; 1,232,466 with the provider editor's Advanced fold and every dialog holding its place, the core's own (10-16); 1,250,533 with the quota refresh kept through redraws, the core's own since the tray panel draws it too, plus 1.5% (#2397); 1,269,083 with Free first's option in the provider editor's ROUTINGS, which the Routing page reads too, plus 1.5%; 1,272,726 with the Providers page drawing its last list at once (#1519), the core's page, and the Routing trace's account names read without Object.entries (#1481), plus 1.5%; a dialog growing out of the row that opened it and folding back into it, the core's own since every page's dialogs open through it (10-20); Codex's and Claude Code's own settings moved from Settings into the agent's row on the Agents page, the core's own since the tray panel and the window both draw them (10-20); 1,314,432 with Settings › Privacy's record of what was masked (its summary, the records view and the local model's controls), which belongs to Settings, the core's own, plus 1.5%; 1,336,481 with a provider's Names & levels saying Provider in model names is Settings' and opening it there (joe), and Settings' Image recognition saying where a custom provider's model is marked (nexnull), both in the core's own pages, with no room added (10-23); 1,337,633 with Settings › Models › Replies' Intent classifier timeout (#2934, reyoung), Settings' own row, drawn by waitRow, which the Image generation timeout's row now shares, with no room added; 1,337,735 with the provider editor's link naming a partner's page by its own host (siteHost) instead of usemagpie.ai's /go link, the core's own editor, with no room added (10-23); 1,338,084 with Check in now saying what the press came to (claimed +credits, already today, not available yet) where it said "refreshed" (#3326), the check-in row the tray panel draws too, the core's own, with no room added (10-23); 1,338,929 with a new partner's tile keeping a small dot until it is opened, in the add sheet, the core's own, with no room added (10-23); 1,343,324 with the sidebar's open-page row marked by one shape that moves on a spring (navTopGo), the window's own shell, which every page sits beside, with no room added (10-23); 1,343,465 with a dialog kept centred while its content comes in, until it is pressed (holdModal, every page's dialogs), the core's own, with no room added (10-24); 1,317,486 with what masking did moved out to Insights › Masking (plugins/redact), the budget lowered to it (10-24); 1,317,876 with Codex's background compaction row saying when a Codex here is too old for its share (codexAsyncHeld, 多喝热水), the agent's own row in the core, with no room added (10-24)+ coreScriptBudget = 1_525_090 // every core script: 1,358,034 after Usage left; 1,380,003 with them; 1,405,937 with the fold; 1,426,102 with 10-16's core work (the GitHub list loading, the move to plugins, Settings › Long conversations), plus 1.5% (#2612); 1,447,368 with loadBack, the window's one state read per return, which every page needs and so is the core's own (1,446,845 before it, 155 bytes under), plus 1.5%; OpenCode Zen's card saying OpenCode tells no key its balance adds ~390 bytes inside it; 1,472,589 with the dialog that grows out of its row and the agents' own settings in their rows, on main's 10-20 core work (the Providers page's last list, the Routing trace's names), plus 1.5% (10-20); 1,506,192 with Settings › Privacy's record of what was masked, plus 1.5%; 1,529,393 with the Intent classifier timeout row (#2934), with no room added; 1,529,495 with the editor's partner link host, with no room added; 1,529,844 with Check in now's press summary (#3326), with no room added; 1,530,689 with the new partner tile's dot, with no room added; 1,535,084 with the sidebar's spring, with no room added; 1,549,478 with the context window card's map (tiles by tokens, the default look, the block grid a switch away) and its text view showing an inline image, in context.js, which the Routing page draws as well as Usage, so the core's own, with no room added (10-24); 1,550,768 with a usage card's refresh opening after its text (#840's card, which the tray panel draws too), the Add key spinner, and a dialog kept centred while its content comes in, with no room added (10-24); 1,524,789 with what masking did moved out to Insights › Masking, lowered to it; 1,525,090 with the Codex row's too-old note (codexAsyncHeld), with no room added (10-24))func TestCoreScriptBudget(t *testing.T) {diff --git a/internal/gui/tests/codex-async-compact.test.cjs b/internal/gui/tests/codex-async-compact.test.cjsindex 6416afe80..92618dfe0 100644--- a/internal/gui/tests/codex-async-compact.test.cjs+++ b/internal/gui/tests/codex-async-compact.test.cjs@@ -14,8 +14,8 @@ const { watchSettingsReads, agentRow, openAgentSettings } = require("./reader.cjconst assets = path.resolve(__dirname, "../assets");-function serve(lang, posts) {- let settings = { theme: "light", lang, tray: "panel", currency: "usd", version: "0.1.900", dir: "~/.config/magpie", gateway: "http://127.0.0.1:3425", proxyNow: "none", proxySource: "none", visionModels: [], imageGenModels: [], titleModels: [], workbuddyCheckins: [], lanURLs: [], redactWords: [], trayUsageEvery: 3 };+function serve(lang, posts, extra = {}) {+ let settings = { theme: "light", lang, tray: "panel", currency: "usd", version: "0.1.900", dir: "~/.config/magpie", gateway: "http://127.0.0.1:3425", proxyNow: "none", proxySource: "none", visionModels: [], imageGenModels: [], titleModels: [], workbuddyCheckins: [], lanURLs: [], redactWords: [], trayUsageEvery: 3, ...extra };const models = ["deepseek-v4-flash", "deepseek-v4-pro"].map((id) => ({ id, name: id, on: true, context: 1000000 }));const provider = { id: "deepseek", name: "DeepSeek", icon: "generic", chat: "https://api.deepseek.example/v1", responses: "", anthropic: "", models, agents: [], key: { set: true, masked: "sk-…1234" }, ready: true, compacts: { "*": 500000, "deepseek-v4-flash": 272000 } };const providers = { providers: [provider], presets: [], excluded: [], gateway: { running: true, window: true } };@@ -61,6 +61,16 @@ const words = {de: { name: "Codex-Hintergrundkomprimierung", field: "Hintergrundkomprimierung ab", bad: "Hintergrundkomprimierung ab: 150 ist kein Prozentwert von 1 bis 100", off: "Aus", on: "An" },};+// what the row says when a Codex here kept the table out (codexAsyncHeld):+// one too old for the feature beside the app of no known version, or the app alone+const held = {+ en: { old: "Codex CLI 0.162.1, Codex app: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%", unknown: "Codex app: the share needs Codex 0.163 or later; until it's updated magpie writes only async_compaction = true, at 65%" },+ zh: { old: "Codex CLI 0.162.1, Codex 应用:阈值需要 Codex 0.163 或更新;更新之前 magpie 只写 async_compaction = true,按 65%", unknown: "Codex 应用:阈值需要 Codex 0.163 或更新;更新之前 magpie 只写 async_compaction = true,按 65%" },+ "zh-TW": { old: "Codex CLI 0.162.1, Codex 應用程式:閾值需要 Codex 0.163 或更新;更新之前 magpie 只寫 async_compaction = true,按 65%", unknown: "Codex 應用程式:閾值需要 Codex 0.163 或更新;更新之前 magpie 只寫 async_compaction = true,按 65%" },+ ja: { old: "Codex CLI 0.162.1, Codex アプリ:しきい値には Codex 0.163 以降が必要です。更新するまで magpie は async_compaction = true だけを書き、65% で圧縮します", unknown: "Codex アプリ:しきい値には Codex 0.163 以降が必要です。更新するまで magpie は async_compaction = true だけを書き、65% で圧縮します" },+ de: { old: "Codex CLI 0.162.1, Codex-App: Die Schwelle braucht Codex 0.163 oder neuer; bis zum Update schreibt magpie nur async_compaction = true, bei 65 %", unknown: "Codex-App: Die Schwelle braucht Codex 0.163 oder neuer; bis zum Update schreibt magpie nur async_compaction = true, bei 65 %" },+};+for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {for (const lang of Object.keys(words)) {const w = words[lang];@@ -103,4 +113,26 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.deepEqual(errors, []);});}+ for (const lang of Object.keys(held)) {+ test(`${engine} ${lang}: the row says when a Codex here kept the share out`, async (t) => {+ const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: process.env.PLAYWRIGHT_CHANNEL || "chromium" }));+ t.after(() => browser.close());+ for (const [kind, readers] of [["old", [{ kind: "cli", version: "0.162.1" }, { kind: "app" }]], ["unknown", [{ kind: "app" }]]]) {+ const page = await (await browser.newContext({ viewport: { width: 900, height: 720 }, reducedMotion: "reduce" })).newPage();+ page.setDefaultTimeout(5000);+ const errors = [], posts = [];+ page.on("pageerror", (e) => errors.push(e.message));+ await page.route("**/*", serve(lang, posts, { codexAsyncCompact: true, codexAsyncHeld: readers }));+ await watchSettingsReads(page);+ await page.goto("http://magpie.test/?view=agents");+ await openAgentSettings(page);+ const note = page.locator("#codexAsyncRow .codex-async-held");+ await note.waitFor();+ assert.equal((await note.textContent()).trim(), held[lang][kind]);+ assert.equal(await page.locator("#codexAsyncRow input.compact-num").isVisible(), true);+ assert.deepEqual(errors, []);+ await page.close();+ }+ });+ }}