ac4af582301a4e8a29245dbba767eba31334ddf9
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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
|
||
|
|
00d44d6928 |
routing: Codex's composer predictions story says their model is picked in Codex's row on the Agents page (#3425, chiperman)
Routing's Kind description for composer_predictions still sent users to Settings › General › Codex composer predictions. That setting moved to Codex's row on the Agents page. chiperman's commit (5e372e168) fixed the Routing text in five languages. It is ported here with their zh, zh-TW and ja; the de wording is mine. Grepping for other texts that still name the old Settings place for a setting that moved into an agent's row found four more, now fixed: - app.js compactField, the provider editor's "Compact at": empty follows Long conversations, now "in their settings on the Agents page (else in Settings)". The field's text is one string now, and the header comment no longer repeats it, so app.js stays inside its budget (unchanged). - gateway sealedWayOut: "Codex subagents on any model" is in Codex's settings on magpie's Agents page, not "magpie's Settings". - gateway codex_titles: "Codex composer predictions are off" and "Codex titles are off" answers name the same place. - cli `magpie model` help text. Each gateway message has a test that fails on the old wording, and the GUI files assert the new place and the absence of the old one. Run on origin/main |
||
|
|
b6831d83e1 |
gateway, gui: Codex's thread descriptions go to a model picked in Settings, apart from its titles (#1198, congee949)
Codex asks its own model, through its ChatGPT sign-in, for each thread's description (thread_description), even while the conversation runs on magpie's models. Settings › General gets "Codex thread descriptions" beside "Codex thread titles". It defaults to Codex's own, which sends the request as Codex sent it, or it can name one of magpie's models or a routing group. The answer is wrapped as description-only JSON. The titles setting is untouched. Usage and Routing show these requests under their own Description purpose. The setting is kept across unrelated Settings saves. There is no Off yet, because Codex's handling of an empty description hasn't been checked. This is a first slice of #742. Squashed from the PR and merged onto current main. Conflicts resolved: - codex_backend.go: the description branch comes after the title branch, ahead of main's subagent pick. - gateway.go: main's CC Switch #1301 comment above the compaction block is kept; the PR had shortened it. - app.js: the gateway-mode list of hidden rows takes the new row. - i18n.js and settings_keep_test.go: both sides kept. - purposes.js: regenerated with go generate ./internal/usage. Run on the merged tree: - gofmt -l is clean. - go vet passes on darwin, linux -tags nogui and windows; the builds on all three succeed. - go test -tags nogui passes for ./internal/gateway, ./internal/gui, ./internal/settings and ./internal/usage. - GUI, chromium and webkit: codex-titles, gateway-mode, purpose-filter, routing-purpose-state, gui-de, gui-ja, gui-zh-tw, i18n-keys, settings-general/-groups/-sections/-search and click-scroll: 118/118. Broken by hand: with the description branch removed from codexBackend and handle, TestCodexDescriptionsSetting, TestCodexDescriptionFallbackOnMagpie and TestNoDescription fail. Not tried: a real Codex thread_description request, and whether Codex's sidebar takes the answer. |
||
|
|
9abfbff607 | cleanup: gofmt the 15 Go files main had unformatted — whitespace, comment alignment and three one-line funcs gofmt opens up; nothing else. go build and vet -tags nogui pass. | ||
|
|
21428865bd | codex titles: a title schema that requires a description beside the title gets one (#743, DuGuaiYA: through magpie's gpt-5.5 Codex kept the first message as the thread's name, the thread_title call a 200 with 27 output tokens) — their Codex's title request asks, strictly, for {"title" (1–36 chars), "description" (at least 1)} and no other field, and magpie handed back {"title"} alone, which fails that schema, so Codex dropped it. The answer now takes the shape from the request's text.format.schema: the title cut to its maxLength, and each other string the schema requires given the model's own value when its JSON had one, else the title, cut to its bounds; a schema with only a title gets {"title"} as before. TestTitleJSONFillsTheSchema (their schema: a plain answer, a JSON answer with a description, a title over 36 characters) fails on the old code. Not tried with that Codex build: the 0.160.0 installed here asks for the title alone. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass (TestClientGoneRecordedAsCanceled flaked once under load; the gateway package passes alone). | ||
|
|
6525e88001 | gateway: Codex gets a title it can read from a magpie model, with magpie as its provider too, and a title answer with none in it shows as failed in Routing and Usage (#743, DuGuaiYA on v0.1.807, Windows: with Codex's session-title model set to a magpie model or group, Codex sessions got no title) — two gaps. Codex's TUI writes a thread's title in a hidden ephemeral turn (thread_source thread_title) that asks for {"title": …} through text.format's json_schema, and parse_thread_title takes the reply only when it starts with { and reads as that object, dropping anything else without a word. magpie keeps text.format only for a Responses upstream, so a Chat or Anthropic model answers in plain text ("Fix login bug"), which Codex turns down. codexTitle (#705) wraps such an answer as {"title": …}, but codexTitlesTo was consulted only on /backend-api/codex/responses, Codex's ChatGPT-sign-in path. With magpie wired as Codex's model provider (model_provider = "magpie", /v1/responses: no ChatGPT sign-in, or an API key) the title request came to handle(), the setting was never read, and the conversation's magpie model's plain answer went back as it was; on the backend path the same happened to a title on a magpie model (a model id with "/") whenever the setting was left empty. Reproduced with codex-cli 0.160.0 in a sandbox HOME/CODEX_HOME against a test magpie and a fake Chat upstream: the title request reached /v1/responses (usage kind thread_title, /v1/responses → /v1/chat/completions), the model said "Fix login bug" and the thread's name in state_5.sqlite stayed empty. codexTitlesTo(h, body, ours) now gives, for a title request: the setting when it is set ("off" or a model), else the model Codex asked for when it is magpie's (every model on /v1, a "/" id on the backend path), else "" (gpt-5.6-luna on ChatGPT goes as before). handle() sends a Responses title request to codexTitle as codexBackend does. titleJSON also drops a leading <think>…</think> a reasoning model leaves in its text, where it made "<think>" the title. When the answer holds no title (empty, or JSON with no title), Codex still gets a finished reply with no title, and the call is no longer a silent 200: codexTitle hands serve a check through the request's context (titleCheckKey/replyCheck) that serve runs on the captured reply before it records the call, so the Routing view's route and the usage row carry "title: no title in the model's answer, so Codex got none: …" (or "…answered with no text…") and count as failed, the vendor's tokens still billed. Codex's base instructions and identity are untouched. TestCodexTitleOnMagpieProvider (Codex's title request on /v1 and on the backend path with a magpie model and the setting empty, "off" heeded on /v1, a plain /v1 turn left alone, an empty answer recorded as failed in both views) and TestTitleJSON's <think> case fail on the old code and pass. go vet, builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Rerun with codex-cli 0.160.0 in the sandbox: the thread is named "Fix login bug". Not tried on Windows or with the reporter's group; a group's member that answers with the schema (a Responses upstream) is read as JSON first, as before. | ||
|
|
65e78e459e | codex: Settings decides where Codex's thread-title requests go — Codex's own ChatGPT as before, off, or a magpie model (#705, DuGuaiYA: Codex signed in with ChatGPT sends thread_title / thread_title_reconsideration requests that magpie relays through ChatGPT even when the conversation is on a magpie provider) — a new setting codexTitles ("" = as Codex sends them, the default; "off"; or a model's id such as deepseek/deepseek-v4-flash or a group) is read on /backend-api/codex/responses for a request whose x-openai-subagent or turn metadata thread_source is a title kind. Off answers at once with an empty completed response (Codex then keeps no title, quietly, as its source shows), contacts nothing, and is still recorded: a Routing trace "Titles off" and a usage row of Kind thread_title marked rejected (left out of stats). A model gets the request through serve (so it is recorded as a title request on that provider), and its answer is given back as one Responses message holding {"title":…}, since Codex's text.format schema does not reach Chat or Anthropic upstreams. Settings has a row "Codex thread titles" (zh: Codex 会话标题) with the app's model menu (Codex's own, Off, magpie's models and groups), saved on its own through POST /api/settings/codex-titles, which refuses a model magpie doesn't serve; the page's other saves keep it. TestCodexTitlesSetting (gateway) fails on the old code (off still went to ChatGPT) and checks the ledger kinds, rejected rows and trace; TestTitleJSON; TestCodexTitlesSetting (gui) for the endpoint; codex-titles.test.cjs (en/zh, webkit) fails on the old assets: no select, the picks post, the subtitle follows, no click scrolls. go vet, builds (darwin nogui, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried with a real Codex TUI: no end-to-end run of Codex's title generation against magpie. |