codexcat

package
v0.1.1252 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package codexcat renders models the way Codex describes them: the entries of its models.json, for `model_catalog_json` and for the model list magpie hands Codex in place of the ChatGPT backend's.

Index

Constants

This section is empty.

Variables

View Source
var Prompt string

Prompt is Codex's generic system prompt (Apache-2.0, openai/codex, core/gpt-5.2-codex_prompt.md). Third-party models need one because the bundled catalog only carries prompts for OpenAI models.

Functions

func AutoReview added in v0.1.1062

func AutoReview(e map[string]any)

AutoReview has one of Codex's own entries name the auto-review model the user picked. With none picked, one magpie put there before — a magpie id, which has a "/" where OpenAI's slugs have none, kept in Codex's cache — is taken out, and one OpenAI gave it is left.

func CacheEntries

func CacheEntries() map[string]map[string]any

CacheEntries is Codex's own models, as models_cache.json describes them for the ChatGPT account it last asked with, by slug.

func Catalog

func Catalog(ms []catalog.Model) []byte

Catalog renders models as a whole models.json, for the effort this machine's Codex starts new sessions at (NewSessionEffort).

func CatalogAt added in v0.1.1214

func CatalogAt(ms []catalog.Model, effort string) []byte

CatalogAt renders models as a whole models.json for a Codex that starts new sessions at effort ("" for its models' own defaults): each model's default_reasoning_level is ModelDefault's.

func DefaultEffort

func DefaultEffort(e []string) string

DefaultEffort picks the middle of the road: "medium" or "high" when offered, else whatever the list starts with.

func Entries

func Entries(ms []catalog.Model, after int) []any

Entries renders models as models.json entries, ranked after the first `after`. Only fields Codex requires or that change behaviour are set; the rest take Codex's defaults. A model's default effort is ModelDefault's for the effort this machine's Codex starts new sessions at.

func Keep added in v0.1.1151

func Keep(cur, b []byte) []byte

Keep is the catalog b, as Catalog renders it, with what the user added by hand to the entries of cur, the catalog on disk magpie is about to write over: a key of an entry of the same slug that magpie doesn't own, and a true where magpie says false of a keepTrue key — supports_reasoning_ summaries, put in for Codex to send a model's effort and show its thinking (#1450). Another key magpie writes takes magpie's value; the entry of a model magpie no longer serves goes. b as it is when there is nothing to keep, or cur isn't a catalog.

func MarkedV1 added in v0.1.715

func MarkedV1(etag string) bool

MarkedV1 reports whether an ETag is of a list magpie stamped V1.

func ModelDefault added in v0.1.1214

func ModelDefault(levels []string, chosen string) string

ModelDefault is the default_reasoning_level of a model of these levels with chosen set for new sessions: chosen when the model takes it, else the level of its own nearest chosen (catalog.NearestEffort: by strength, a tie going up — xhigh on a model of high and max is max), the one the gateway would send it at anyway. Codex takes a model's default when it is switched to: the CLI's /model offers it first and saves it as the effort, and the Codex app keeps the current effort only for a model that lists it. With the middle of the road there, a session started at xhigh dropped to medium on a switch to a routing group (Creat.wu on Discord). Nothing chosen, or nothing near it, keeps DefaultEffort.

func NewSessionEffort added in v0.1.1214

func NewSessionEffort() string

NewSessionEffort is the effort a new Codex session starts at, as the top of this machine's Codex config.toml says it (model_reasoning_effort, magpie's "New sessions" effort, or the one Codex's own picker last saved); "" when it is unset or the config can't be read.

func Order added in v0.1.952

func Order(entries []any, at map[string]int)

Order ranks entries — Codex's own, as the backend gives them, and magpie's from Entries — in the order the user put them in (#855): Codex lists its models by priority, lowest first. The ones at names go first, by their place there; the others after them, as they stood. The slice is put in that order too.

func PolicyTag added in v0.1.715

func PolicyTag(tag string) string

PolicyTag is a list's tag with the V1 setting in it.

func Remember added in v0.1.715

func Remember(entries []any)

Remember keeps the versions of entries as the backend gave them, before any is stamped: those of slugs it names are replaced, the rest kept.

func ServiceTiers added in v0.1.1159

func ServiceTiers(ms []catalog.Model) map[string][]tier

ServiceTiers are the service tiers Entries offers Codex on each of ms, by id, where it offers any: what this magpie's list tells another magpie that has it as its provider, so that one's Codex is offered them too (#1234).

func Stamp added in v0.1.715

func Stamp(e map[string]any)

Stamp has an entry say multi-agent V1.

func Tag added in v0.1.54

func Tag(ms []catalog.Model) string

Tag names a list of magpie's models: another list, another tag.

func Tagged added in v0.1.54

func Tagged(etag, tag string) bool

Tagged reports whether an ETag carries this tag.

func TakesEffort added in v0.1.1150

func TakesEffort(ms []catalog.Model, id string) string

TakesEffort is the effort Codex takes for the model id when none is set: the default_reasoning_level of the entry it reads for it. Codex's own model and a ChatGPT account's (codex/) keep their entry from Codex's models_cache.json, so it is that entry's (gpt-6.1-sol: low); one of magpie's other models takes the one Entries writes. "" when the model has no levels, or Codex's entry names none.

func V1 added in v0.1.715

func V1() bool

V1 reports whether the OpenAI models magpie hands Codex say "v1".

func Window added in v0.1.757

func Window(e map[string]any, n, most int)

Window has one of Codex's own entries say a context window of n tokens (none: as it says), and most at the most it may be raised to (0: as it says). Only those two fields change. An entry whose max_context_window is below its window — one the user set past what OpenAI lists — would say two things at once, and Codex may hold the window to the max, so the max is raised to it.

func WithTag added in v0.1.54

func WithTag(etag, tag string) string

WithTag is an ETag of the backend's (or none) with magpie's tag in it: W/"abc" becomes W/"abc+magpie-<tag>".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL