ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3eb2bda4f2 |
settings: Codex, Claude Code and Grok Build each take a Long conversations of their own (molianyin4227 on Discord)
molianyin4227 (Discord #help): models differ, so one compaction size
for every agent fits none; they asked for Codex, Claude Code and Grok
Build to each have their own, falling back to the shared one.
- settings.AgentCompacts[agent] {At, Full} for the agents that write a
compaction window (CompactAgents: codex, claude, grok); Settings.
ForAgent(agent) lays it over CompactAt/FullContext for that agent's
readers only: codexcat.entriesAt, provider codexListed, Claude Code's
writeCompact and desktopPlan, grokModelTables, the route list's
buildModels, Codex's window line (api.go) and Tuned for you
(gui/tune.go, agent/tune.go). A model's or provider's own Compact at
still comes first. An agent with none follows the shared value, so
nothing new is written for it, and an agent outside the three has no
such key and is refused (provider.SetAgentCompact).
- POST /api/settings/agent-compact {agent, own, full, at}; own false
takes the agent's value away. settingsapi.Merge keeps the map.
- GUI: a row "Long conversations in <agent>" under Long conversations,
in the agent's opened row and its sheet: Every agent / Compact at N /
Full window (segs, no select), a size box when Compact at. It lives in
agentcompact.js, imported when the agent's settings hold Long
conversations, then put in synchronously (an async put-in after a
redraw moved the page in chromium: codex-memories-settings' scroll
check). It draws again only when its own values change. i18n in
zh, zh-TW, ja, de.
- Tuned for you's Use on an agent with its own value changes that one,
stashed under tune.long.compact.<agent>; Undo puts it back.
- codex-memories-settings' "no Codex" check counts Long conversations
alone again (:not(.agent-compact)) and waits for the new row.
- docs/subsystems/agent-wiring.md: a row for it.
Core size: app.js 1,311,919 bytes, 109 under origin/main
|
||
|
|
85fcac4a47 |
codexcat: a model with no known window still compacts where the user set
jiangguochao666 on X: "这个软件自动压缩设置之后还是不会启动啊,codex里面压缩还剩<一半的时候报错,只能手动压缩才可以".
Cause: when magpie knows no window for a model (a relay that lists no
context_length, a model models.dev lacks), entriesAt and listedEntry
wrote neither context_window nor auto_compact_token_limit, so Long
conversations' Compact at (and a model's own) was dropped. Codex 0.165's
ModelInfo::auto_compact_token_limit is then None and it never
auto-compacts; on the vendor's context_length_exceeded it calls
set_total_tokens_full, a no-op with no window, and errors, so every
later turn errors again until a manual /compact. Codex shows such a
model on its fallback window, which is why the error comes with "<half"
left.
Now such an entry gets the threshold alone as auto_compact_token_limit
(the model's Compact, else settings.Compact(): Compact at, else 272K;
none under Full window). A relay's own listed entry gets a user-set one
only (the model's, or Compact at), and not when its own context_window
or limit is already at or under it.
Run:
- Real Codex 0.165 on mote, sandbox HOME (~/cxc/h*), a fake relay
refusing past 100K with context_length_exceeded and listing no
window, magpie serve on 47812, `magpie model compact 80k`, 7 turns of
~20K tokens through `codex exec` / `exec resume --last`:
- old build (h2): catalog None/None, 400 at ~119K, every later turn
"Codex ran out of room";
- this build (h4): catalog None/80000, CONTEXT CHECKPOINT COMPACTION
at 80.6K, no 400 in 7 turns.
- control (h1, old build, relay lists 200K): compacted at ~80.5K.
- go test ./... -timeout 45m on mote at
|
||
|
|
deb0b8da72 |
codexcat: Codex shows a model's whole window and compacts at Long conversations' threshold (#3975, #3562; 01huadalang on Discord)
01huadalang on Discord: a Command Code model with a 1M window showed
258,400 in Codex. EasonSpirit (#3975) and greenfinchgreen-gif (#3562)
saw the same on OpenCode Go's 1M models.
The cause: magpie put Long conversations' threshold (272K by default, a
Compact at set on the model or provider, or a size typed in Settings)
into the Codex catalog entry's context_window, and the real window into
max_context_window. Codex shows context_window at 95% as the
conversation's context, so 272000 showed as 258400. The plugin was not
at fault: commandcode lists these models at 1M, from Command Code's
own list or its fallback table.
Now each catalog entry carries two values:
- context_window is the model's whole window.
- auto_compact_token_limit is the threshold, written only when it is
below the window. Full window writes none.
This applies to entries magpie writes itself (entriesAt) and to a
relay's own Codex-shape entry (listedEntry). Codex 0.165 compacts at
the lesser of the threshold and 90% of the window. A
model_auto_compact_token_limit the user put in config.toml still comes
first.
Two other changes:
- max_context_window is never written now. It stays a field of
codexcat's model, so Keep doesn't carry an old catalog's value
forward as if the user had added it.
- Tag carries a format mark (catalogFormat), so a Codex holding a list
in the old shape fetches it again.
Codex's own models (codex/) and Codex's base_instructions are
unchanged.
One behaviour moves. Codex used to compact at 90% of 272000 (244,800).
It now compacts at 272,000, the number the setting shows ("Compact at
272K").
Tests:
- TestCodexWindowShownCompactApart (new). Checks Command Code's
claude-opus-5-5 at 1M, a relay entry, and a relay entry with its own
Compact at, under the default, Compact at 400K, and Full window.
- TestCodexCatalogCompactAt, TestCodexCatalogToolSearch,
TestCodexCatalogCompactAtReachesDisk and
TestTypedWindowReachesCodexAndClaudeCode now expect the window in
context_window and the threshold in auto_compact_token_limit.
Broken by hand: I put the old codexcat.go back. TestCodexCatalogToolSearch,
TestCodexCatalogCompactAt and TestCodexWindowShownCompactApart went red
("commandcode/claude-opus-5-5 told window/compact [272000 <nil>]; want
[1e+06 272000]"). With this change restored, all three are green.
Real Codex 0.165.0 in a sandbox CODEX_HOME, against a local fake
Responses server, using the catalog codexcat.Catalog now writes for
commandcode/claude-opus-5-5 at 1M:
- The rollout records model_context_window 950000. The old-shape entry
(272000 with a max of 1000000) records 258400, the reporter's number.
- A turn reporting 260K tokens is not compacted. One reporting 280K is
(CONTEXT CHECKPOINT COMPACTION). The old shape compacted at 260K.
- model_auto_compact_token_limit = 500000 in config.toml keeps the
280K turn uncompacted.
Run (mote-run, at this change on origin/main 9b833205f; rebased onto
|
||
|
|
1aaac93b52 |
provider, gui: Compact at — where Codex and Claude Code compact a long conversation, set per provider or per model in its editor and to any size in Settings → Long conversations (#876, hisiling)
Until now the only choice was 272K for every model or Full window for every model. The 272K default stays as it is (
|