Lightweight coding agent that runs in your terminal
Rust
Refine OpenAI docs skill source routing (#36014)
Vaibhav Srivastava5082373f181
diff --git a/codex-rs/skills/src/assets/samples/openai-docs/SKILL.md b/codex-rs/skills/src/assets/samples/openai-docs/SKILL.mdindex 55d584128d..f74454101e 100644--- a/codex-rs/skills/src/assets/samples/openai-docs/SKILL.md+++ b/codex-rs/skills/src/assets/samples/openai-docs/SKILL.md@@ -1,183 +1,38 @@---name: "openai-docs"-description: "Use when the user asks how to build with OpenAI products or APIs, asks about Codex itself or choosing Codex surfaces, needs up-to-date official documentation with citations, help choosing the latest model for a use case, latest/current/default-model prompting guidance, or model upgrade and prompt-upgrade guidance; use OpenAI docs MCP tools for non-Codex docs questions, use the Codex manual helper first for broad Codex self-knowledge, and restrict fallback browsing to official OpenAI domains."+description: "Use for Codex models/pricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs/products and ChatGPT Work. Also use for model choice/migration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat/Work/Codex comparisons. Do not use for generic app/software tasks that merely mention Codex."+metadata:+ short-description: "Codex models/pricing, scheduled tasks, skills, settings, setup, troubleshooting, and self-knowledge; OpenAI APIs and ChatGPT Work. 'You'/'this app' means Codex only."----# OpenAI Docs-Provide authoritative, current guidance from OpenAI developer docs using the developers.openai.com MCP server. "Docs MCP" means `mcp__openaiDeveloperDocs__search_openai_docs` and `mcp__openaiDeveloperDocs__fetch_openai_doc`; for API reference, schema, parameter, or required-field questions, also use `mcp__openaiDeveloperDocs__get_openapi_spec` when available. Official-domain web search is fallback after those tools are unavailable or unhelpful. Broad Codex questions use the manual helper before Docs MCP. This skill also owns model selection, API model migration, and prompt-upgrade guidance.--## API Key Setup--For requests to build, run, configure, debug, or implement an API-backed app, script, CLI, generator, or tool, use `openai-platform-api-key` first when available. After that credential gate is resolved, return here for current docs as needed.--Use this skill directly for docs-only questions, citations, model/API guidance, conceptual explanations, and examples that do not require building or running an API-backed artifact.--For latest/current/default/unspecified model migration or prompting-guidance requests, complete the read-only latest-model resolver and guide fetch before the API-key credential gate. The credential gate still blocks edits, tests, and API-backed implementation until resolved; it does not block read-only retrieval of current model, migration, or prompting guidance.--## First action for latest-model changes--Before reading memory, inspecting the repo, fetching docs, or checking API credentials, classify the request:--- **Latest/current prompting guidance, or change requested + latest/current/newest/recommended/default/flagship/unspecified target:** immediately run the resolver with the platform-specific command below and inspect its JSON output. This includes asking how to prompt the latest model, changing prompts, a model picker, model references, an SDK integration, replacing an older named model with "the current model", or asking "which model should I migrate/upgrade to?". Do not directly fetch `latest-model.md` for this branch.-- **Pure model-selection question only, with no prompting guidance or requested change:** directly fetch `https://developers.openai.com/api/docs/guides/latest-model.md`; do not run the resolver.-- **Change requested + explicit target model:** preserve that target; do not run the latest-model resolver. For an explicit GPT-5.6 Sol or GPT-5.6-family migration, fetch the live GPT-5.6 model-guidance page and read `references/upgrading-to-gpt-5p6-sol.md` for skill-specific migration judgment.-- **Prompting or migration guidance for an explicitly named GPT-5-family model:** fetch `https://developers.openai.com/api/docs/guides/model-guidance?model=<requested-model>` through Docs MCP and extract the relevant migration section or the `## Prompting Best Practices` section through the next H2 heading. Do not substitute latest-model guidance.--Run the resolver without relying on filesystem executable bits:--- POSIX shells: `sh <skill-dir>/scripts/resolve-latest-model-info`-- Windows: run the CommonJS implementation with Node.js 18 or newer: `node <skill-dir>\scripts\resolve-latest-model-info.cjs`. If `node` is unavailable or too old and `load_workspace_dependencies` is available, use the Node.js executable it returns for this command. Do not try to execute the extensionless POSIX wrapper directly on Windows.--For the resolver branch, do not suppress or redirect its stdout. Success requires JSON containing `model`, `migrationGuideUrl`, and `promptingGuideUrl`; if the command exits without all three fields, run it once more before any fallback.--## Source Priority--- For Codex self-knowledge, use the Codex source route below; it owns when to use the manual helper, Docs MCP, or bounded uncertainty.-- For non-Codex OpenAI docs questions, use `mcp__openaiDeveloperDocs__search_openai_docs` to find the most relevant doc pages.-- For non-Codex OpenAI docs questions, fetch the relevant page with `mcp__openaiDeveloperDocs__fetch_openai_doc` before answering. If search is noisy, run a narrower Docs MCP search; when any plausible official OpenAI docs URL is known or found, try fetching that URL through Docs MCP before relying on web-search content.-- For API reference, schema, parameter, or required-field questions, use `mcp__openaiDeveloperDocs__get_openapi_spec` when available to verify the API shape alongside the relevant guide or reference page.-- Use `mcp__openaiDeveloperDocs__list_openai_docs` only when you need to browse or discover non-Codex pages without a clear query.-- For latest/current prompting guidance, model upgrades, or prompt upgrades, apply the first-action classifier above and use its platform-specific resolver command. On POSIX, the wrapper uses a compatible Node.js 18+ runtime from `$NODE`, PATH, or bundled/system fallbacks. On Windows, use a compatible Node.js executable to run the `.cjs` implementation directly. If no compatible runtime is available, call `load_workspace_dependencies` when available and retry the appropriate command once with the returned Node.js executable.-- For docs-only model-selection questions that do not ask to change an app, project, repo, model configuration, or prompts, fetch `https://developers.openai.com/api/docs/guides/latest-model.md` first. If that is unavailable, load `references/latest-model.md`.-- Preserve explicit target requests: if the user names a target model like "migrate to GPT-5.4", keep that requested target even if `latest-model.md` names a newer model. Mention newer guidance only as optional.-- If current remote guidance is needed, treat the returned migration and prompting guide URLs as opaque and fetch those exact URLs directly. Do not derive, substitute, or append a model query to them. If a prompting guide URL resolves to a combined model-guidance page, extract only the `## Prompting Best Practices` section through the next H2 heading. If a fetched guide contains only a title or no substantive body, retry the exact markdown URL through MCP/search fallback; if that also fails, use bundled fallback references and disclose the fallback.--## OpenAI product snapshots--1. Apps SDK: Build ChatGPT apps by providing a web component UI and an MCP server that exposes your app's tools to ChatGPT.-2. Responses API: A unified endpoint designed for stateful, multimodal, tool-using interactions in agentic workflows.-3. Chat Completions API: Generate a model response from a list of messages comprising a conversation.-4. Codex: OpenAI's coding agent for software development that can write, understand, review, and debug code.-5. gpt-oss: Open-weight OpenAI reasoning models (gpt-oss-120b and gpt-oss-20b) released under the Apache 2.0 license.-6. Realtime API: Build low-latency, multimodal experiences including natural speech-to-speech conversations.-7. Agents SDK: A toolkit for building agentic apps where a model can use tools and context, hand off to other agents, stream partial results, and keep a full trace.--## Codex self-knowledge--Use this path for questions about Codex itself: configuring, extending, operating, troubleshooting, local state, product surfaces, or where Codex behavior should live. A codebase merely mentioning a plugin, skill, hook, MCP server, browser, or automation is not enough. For generic software tasks, answer the software task directly; if asked whether Codex self-knowledge applies, answer that meta question briefly and continue the requested artifact.--### Source Route--The Codex manual is the first source for broad Codex synthesis. Treat the manual and Docs MCP as different lanes, not interchangeable official-doc sources. For published-user Codex product answers, the source route is complete: the manual, Docs MCP when this route calls for it, official OpenAI web fallback, and callable capabilities surfaced in the current session when the question is about that capability. Knowledge bases outside developers.openai.com are outside this route for public product answers.--For broad Codex behavior, setup, customization, skills, plugins, MCP, hooks, `AGENTS.md`, automations, surfaces, local state, or system-map questions:--1. Reuse a same-thread manual and outline path when it is still fresh.-2. Otherwise run the skill-local helper first in normal writable sessions. Skip it without trying only when the session is explicitly read-only, shell execution is unavailable, or visible policy shows no allowed temp cache.-3. By default, the helper chooses the first usable temp cache dir in this order: `$TMPDIR/openai-docs-cache`, `%TEMP%\openai-docs-cache`, `%TMP%\openai-docs-cache`, `/private/tmp/openai-docs-cache`, then `/tmp/openai-docs-cache`. Workspace-only write access is not enough for this temp cache.-4. Run the helper directly unless you need to override the cache dir. The helper falls back to `curl` when native `fetch` is unavailable or when proxy env vars are present, so no shell-specific proxy prefix is required. Resolve `<skill-dir>` to this skill's actual directory; in copied local eval workdirs this is usually `.codex/skills/openai-docs`:--```bash-node <skill-dir>/scripts/fetch-codex-manual.mjs-```--If you need to override the cache dir, pass `--cache-dir <cache-dir>`. On Windows, the helper checks `%TEMP%` and `%TMP%` automatically; in PowerShell, `$env:TEMP\\openai-docs-cache` is a typical explicit override.--Treat helper availability as established by explicit read-only/no-shell policy or an actual command result. A guessed sandbox or guessed helper failure is not enough to switch to Docs MCP or web lookup; after an actual helper command failure, continue to the narrowest official next source below.--The helper verifies freshness, writes `codex-manual.md`, and emits `codex-manual.outline.md`. The outline maps source pages and headings to line ranges; use it to choose the relevant manual section, then read or search targeted manual sections for Codex product facts. Use the skill directory to locate and run the helper; after the helper succeeds, use the returned manual and outline paths as the search scope for Codex product facts and term coverage checks.--Reuse the same-thread manual and outline paths for follow-up Codex questions. Refresh first when the manual was fetched more than about a day ago, the path is unusable, the path came from another thread or uncertain provenance, or likely-current information is missing and staleness is plausible.--For questions about whether the manual is current enough to rely on now, run the helper when temp caching is allowed and base the answer on its returned status, manual path, and outline path.--If the manual resolves a Codex claim, answer from it and stop expanding sources for that claim; continue the user's broader task if the docs lookup was only one dependency. Manual source pages and known anchors are enough citation support for manual-covered material.--If the helper is skipped because the session is read-only, has no shell execution, or has no allowed temp cache, the next source is Docs MCP: call `mcp__openaiDeveloperDocs__search_openai_docs`, then `mcp__openaiDeveloperDocs__fetch_openai_doc` for a relevant hit before any web fallback.--If a user names a Codex term or mode that a fresh manual does not use, search the manual for obvious adjacent concepts, then answer that the exact term is not documented and use the closest documented terminology. If the prompt asks how that term maps to Codex behavior, resolve the mapping from adjacent manual sections. If the exact term remains material or likely current after that manual pass, use one narrow Docs MCP search/fetch before bounded uncertainty; otherwise, the source lookup for that terminology or mapping claim is complete.--Use the narrowest official next source only when the manual is unavailable, the helper fails, temp caching is not allowed, another material claim is missing or likely stale, or the user explicitly needs a page-specific citation. Prefer one specific Docs MCP search and, if it returns a clearly relevant page, one fetch; for unresolved Codex capability names, acronyms, scheduling terms, or exact error text, this Docs MCP step is the next source before web search. After the manual plus any permitted Docs MCP gap-fill, resolve remaining gaps as bounded uncertainty. Use official-domain web fallback only after that Docs MCP path is unavailable or unhelpful. If the claim is still not established, stop with bounded uncertainty. If official docs/manual conflict with a callable capability already surfaced in the current session, state the conflict and prefer verified current-session behavior for that environment.--For undocumented or private-looking model slugs, product mode labels, entitlement labels, account access paths, or rollout names, answer from current public docs and bounded uncertainty. Those labels are not a reason to leave the public source route.--For support-style diagnostics, prefer a layer-by-layer answer from the manual over provider-specific web lookups: installed/enabled plugin, bundled app or connector authorization, MCP setup, workspace/admin policy, restart or new-thread expectations, then support or feedback if still unresolved.--If the source route still does not establish a claim, return bounded uncertainty or route to support, an admin, or product feedback instead of widening the investigation.--For unresolved product terminology, answer from the manual plus the allowed official next source. If those sources do not establish the term, answer with bounded uncertainty from those sources.--### Surface Map--When Codex nouns or durable-instruction surfaces overlap, recommend the smallest surface that matches the scope:--- Prompt or thread context -> one-off task constraints.-- `AGENTS.md` -> durable repo conventions, commands, verification steps, and review expectations; closer nested files apply under their subtree.-- Project `.codex/config.toml` -> trusted-repo Codex settings such as sandbox, MCP, hooks, model, or reasoning defaults.-- Global config or global guidance -> personal defaults across repos.-- Skill -> reusable task workflow with references or scripts.-- Plugin -> installable bundle with skills plus commands, tools, MCP config, hooks, assets, apps, or marketplace metadata.-- MCP server or app connector -> live external data/actions or authorized private app/workspace data. Use connectors for private Google Docs, Calendar, Slack, GitHub, Notion, and similar data instead of web search or model memory.-- Automation -> scheduled checks, reminders, monitors, or follow-up work; use a thread heartbeat when continuity in an existing thread matters.-- Hook -> lifecycle enforcement around tool calls, commands, or file edits.--Split mixed-scope requests instead of forcing one answer. Example: "always do X, but only for this PR" defaults to prompt/thread context for the current run; use `AGENTS.md` or project config only if it should persist, hooks only for mechanical enforcement, and automations only for scheduled or follow-up work.--Use this quick product map when needed: CLI is terminal-first local repo work; IDE extension is editor-attached coding; Codex app is desktop planning, review, and interactive work; cloud/web is hosted parallel/offloaded work; Browser Use/in-app browser is Codex-controlled web testing; Chrome extension uses the user's Chrome profile; Computer Use controls desktop apps and OS UI. Keep `config.toml` defaults, `requirements.toml` constraints, and managed/admin policy separate.--### Boundaries And Output--- API key auth does not imply ChatGPT, cloud task, or connector access. For plugin/app/auth failures, check bundle availability, plugin installed/enabled state, connector/app authorization, MCP setup, restart/refresh expectations, workspace policy, and per-surface availability before answering.-- Sandbox or network denials need scoped escalation with a clear justification. Destructive commands, writes outside the workspace, or broad access changes require explicit approval.-- Memory can provide user preference or context, but explicit prompt instructions win and memory is not a source for current external facts.-- For affirmative surface-selection answers, use this shape: recommendation, why, what to avoid, and the manual/source evidence used.-- When page-specific Codex citations are actually needed, these anchors often fit: `concepts/customization#agents-guidance` for `AGENTS.md`, `concepts/customization#skills` for skills, `plugins/build#plugin-structure` for plugins, `concepts/customization#mcp` for MCP, `config-advanced#hooks` for hooks, `app/automations#thread-automations` for thread automations, and `config-reference#configtoml` for config.--## If MCP server is missing--If MCP tools fail or no OpenAI docs resources are available:+Provide current, cited OpenAI product, API, model, and Codex guidance. Read zero or one primary reference.-1. Run the install command yourself: `codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp`-2. If it fails due to permissions/sandboxing, immediately retry the same command with escalated permissions and include a 1-sentence justification for approval.-3. Ask the user to run the install command only if the escalated attempt fails.-4. Ask the user to restart Codex.-5. Re-run the doc search/fetch after restart.+**First substantive action:** Search the user's exact requested official OpenAI documentation topic and any explicitly named model using a concise, topic-specific query of 2-6 essential terms. When an already-available direct official documentation search and page-retrieval capability is present, use it first: search, then fetch or open the matching official page before general web search. Otherwise, immediately use official-domain web search, then actually open or fetch the relevant official page. Complete this source order before reading a reference, inspecting local or repository files, running a Codex manual or model resolver, drafting a plan, or answering from memory. Use the actual fetched page, not a search snippet or an unopened link. If one official search or page does not establish the answer, search another appropriate official domain and actually open or fetch the result. Preserve the exact requested model; never substitute a newer model.-## Workflow+**Only exception:** An explicitly requested, genuinely broad, cross-topic Codex setup, orientation, or system-map synthesis may use the manual first when shell execution and an allowed temporary cache are available. A specific Codex feature, setting, command, error, model, or requested citation remains docs-first. Mixed Chat/Work/Codex comparisons are official documentation questions, not manual-first Codex requests.-1. Clarify whether the request is general docs lookup, model selection, a model-string upgrade, prompt-upgrade guidance, or broader API/provider migration.-2. For Codex self-knowledge requests, follow the Codex self-knowledge source procedure above.-3. For model-selection or upgrade requests, prefer current remote docs over bundled references when the user asks for latest/current/default guidance.- - For docs-only model-selection questions, fetch `https://developers.openai.com/api/docs/guides/latest-model.md`, find the latest model ID and explicit migration or prompt-guidance links, and prefer explicit links over derived URLs.- - For explicit named-model requests, preserve the requested model target. Mention newer remote guidance only as optional.- - For latest/current/default prompting guidance or dynamic upgrades, run the resolver with the platform-specific command above as the first docs operation before any direct latest-model.md fetch or API-key credential gate, then fetch both returned guide URLs directly when possible.- - Fetch returned guide URLs exactly; do not derive or substitute model-specific URLs.- - If a direct guide fetch fails or returns only a title, use the developer-docs MCP tools or official OpenAI-domain search to find the same guide content.- - If remote docs are unavailable, use bundled fallback references and say that fallback guidance was used.-4. For model upgrades, keep changes behavior-preserving and scoped: update active OpenAI API model defaults, directly related prompts, and the registries, routing, pricing, capability, or picker surfaces that the user actually placed in scope.-5. Leave historical docs, examples, eval baselines, fixtures, provider comparisons, intentionally pinned fallbacks, and ambiguous older model usage unchanged unless the user explicitly asks to upgrade them. Do not collapse a multi-model router or picker into one flagship model; preserve the existing cost, latency, and quality roles.-6. Keep SDK, tooling, IDE, plugin, shell, auth, and provider-environment migrations out of a model-and-prompt upgrade unless the user explicitly asks for them.-7. If a safe upgrade needs API-surface changes, schema rewiring, tool-handler changes, or broader implementation work, classify it explicitly. Make those changes when implementation is within the user's requested scope; otherwise report the exact blocker or confirmation needed instead of silently changing behavior.-8. For general docs lookup, start with a compact, title-like search query of 2-6 essential terms. Do not turn the full user question into a keyword list. Fetch the best page and exact section needed, and answer with concise citations.+For generic software tasks, answer the software task directly. OpenAI implementation, debugging, SDK, API, prompting, agent, and eval requests are not generic.-## Reference map+For a straightforward factual or citation-only request, follow the source order and do not read a route reference. This includes straightforward API facts, ChatGPT Work or mixed Chat/Work/Codex comparisons, model tiers, aliases, Pro mode, reasoning settings, factual migration baselines, and narrow Codex facts. Prioritize `learn.chatgpt.com` for ChatGPT Work.-Read only what you need:+## Choose one primary route-- `https://developers.openai.com/api/docs/guides/latest-model.md` -> current model-selection and "best/latest/current model" questions.-- `scripts/fetch-codex-manual.mjs` -> current Codex manual fetch, verification, local temp cache, and outline generation.-- `https://developers.openai.com/codex/codex-manual.md` -> current Codex self-knowledge synthesis, including setup, customization, skills, plugins, MCP, hooks, `AGENTS.md`, automations, and surface behavior; normally access it through the helper path and targeted file reads when temp caching is available.-- `references/latest-model.md` -> bundled fallback for model-selection and "best/latest/current model" questions.-- `references/upgrade-guide.md` -> bundled routing fallback for model upgrade and upgrade-planning requests.-- `references/upgrading-to-gpt-5p6-sol.md` -> GPT-5.6 Sol/family migration judgment, compatibility gates, optional feature boundaries, and validation.-- `references/prompting-guide.md` -> bundled GPT-5.6 prompting fallback plus the live Prompting Best Practices extraction contract.+Use the first matching route, and read its reference only when the requested task needs that specialized workflow:-## Quality rules+- **Explicitly requested local documentation integration:** Read [integration guidance](references/mcp-diagnostics.md) only when the user explicitly requests that local integration.+- **Model migration, upgrades, or model-specific prompting:** Read [model-migration.md](references/model-migration.md) for actual migration planning, implementation, dynamic target resolution, or prompt changes. Preserve an explicitly requested target.+- **Model selection and comparisons:** Read [model-selection.md](references/model-selection.md) only when nuanced current, latest, default, cost, latency, quality, or modality tradeoffs need more guidance. Do not run a migration resolver for selection alone.+- **Product, API, ChatGPT Work, and mixed Chat/Work/Codex documentation:** Read [official-docs.md](references/official-docs.md) only when fetched official pages leave source selection, API schemas, or the requested implementation unresolved. This route is not manual-first.+- **Explicitly broad Codex setup, orientation, or cross-topic synthesis:** Read [codex-self-knowledge.md](references/codex-self-knowledge.md) when the eligible Codex manual or deeper Codex procedures are needed.-- Treat OpenAI docs as the source of truth; avoid speculation.-- For Codex self-knowledge, follow the source route above instead of relying on remembered behavior.-- Keep migration changes narrow and behavior-preserving.-- Prefer prompt-only upgrades when possible.-- Avoid inventing pricing, availability, parameters, API changes, or breaking changes.-- Keep quotes short and within policy limits; prefer paraphrase with citations.-- If multiple pages differ, call out the difference and cite both.-- If official docs and verified callable current-session behavior disagree, state the conflict before making broad claims or edits.-- If docs do not cover the user’s need, say so and offer next steps.+Read at most one primary reference. Do not open every route, bundled model guide, or helper script. Read a supporting reference or run a helper only when the chosen workflow demonstrably needs it.-## Tooling notes+## Source and execution boundaries-- Use MCP doc tools before web search for OpenAI-related markdown docs. The Codex manual flow is the exception: follow the Codex self-knowledge source procedure for broad Codex synthesis.-- If the MCP server is installed but returns no meaningful results, then use web search as a fallback.-- When falling back to web search, restrict to official OpenAI domains (developers.openai.com, platform.openai.com) and cite sources.+- Search, open, fetch, and cite only `developers.openai.com`, `platform.openai.com`, and `learn.chatgpt.com`. Cite the page that supports the claim. State uncertainty when official sources do not establish pricing, availability, account access, limits, or behavior.+- Preserve an explicitly requested model for selection, migration, and prompting. Resolve an unspecified latest or current migration target only after searching and fetching current official guidance.+- Use `references/latest-model.md` only as a disclosed fallback after current official model guidance does not answer the question. Read `references/upgrading-to-gpt-5p6-sol.md` only for an actual, requested GPT-5.6-family migration; read `references/prompting-guide.md` only for requested prompting work.+- Before building, running, editing, debugging, or testing an API-backed app or tool, use `openai-platform-api-key` first when available. Documentation, conceptual examples, model selection, and read-only guidance do not require an API key.+- Say "OpenAI Docs" or "official OpenAI documentation" in user-facing answers. Keep exact official citations and examples concise.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/agents/openai.yaml b/codex-rs/skills/src/assets/samples/openai-docs/agents/openai.yamlindex 8bbf03c206..da825cdd65 100644--- a/codex-rs/skills/src/assets/samples/openai-docs/agents/openai.yaml+++ b/codex-rs/skills/src/assets/samples/openai-docs/agents/openai.yaml@@ -1,14 +1,6 @@interface:display_name: "OpenAI Docs"- short_description: "Reference OpenAI docs, Codex self-knowledge, and model migration guidance"+ short_description: "OpenAI and Codex docs for models, skills, tasks, and setup"icon_small: "./assets/openai-small.svg"icon_large: "./assets/openai.png"default_prompt: "Use OpenAI Docs for official docs lookup, questions about Codex itself or Codex surfaces, model selection, model migration, and prompt-upgrade work."--dependencies:- tools:- - type: "mcp"- value: "openaiDeveloperDocs"- description: "OpenAI Developer Docs MCP server"- transport: "streamable_http"- url: "https://developers.openai.com/mcp"diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/codex-self-knowledge.md b/codex-rs/skills/src/assets/samples/openai-docs/references/codex-self-knowledge.mdnew file mode 100644index 0000000000..f019531366--- /dev/null+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/codex-self-knowledge.md@@ -0,0 +1,71 @@+# Codex self-knowledge++Use this manual-first route only for genuinely broad Codex setup, orientation, customization, troubleshooting, local-state guidance, or system-map synthesis across skills, plugins, MCP, hooks, `AGENTS.md`, automations, and product surfaces. Mixed Chat/Work/Codex comparisons belong to `official-docs.md` instead.++Narrow Codex documentation questions require official documentation search first, then an actual page open or fetch using an available documentation or official-domain web capability. This includes a single feature such as Codex Goals, a specific setting, documented behavior, exact error, or requested page citation. Search and fetch the exact official topic before inspecting local files or bundled references. Do not fetch the manual, read bundled references, inspect local configuration or caches, or turn a targeted documentation lookup into broad product synthesis. Current or latest model questions follow the model-selection route.++## Start with the manual++Reuse a manual path and outline path already established in the same thread when both remain usable and current. Refresh before relying on a path fetched more than about a day ago, obtained from another thread or uncertain source, or missing likely-current information.++Otherwise, run the bundled manual helper first. Skip it without probing only when policy explicitly makes the session read-only, shell execution unavailable, or every allowed temporary cache location unavailable. Workspace-only write access is not enough: the helper needs an allowed writable temp cache. A guessed sandbox restriction is not evidence that the helper is unavailable.++Resolve `<skill-dir>` to the actual installed skill directory, then run:++```bash+node <skill-dir>/scripts/fetch-codex-manual.mjs+```++The helper automatically chooses the first usable cache location in this order:++1. `$TMPDIR/openai-docs-cache`+2. `%TEMP%\openai-docs-cache`+3. `%TMP%\openai-docs-cache`+4. `/private/tmp/openai-docs-cache`+5. `/tmp/openai-docs-cache`++Use an explicit override only when the allowed cache must be selected manually:++```bash+node <skill-dir>/scripts/fetch-codex-manual.mjs --cache-dir <cache-dir>+```++On Windows, `%TEMP%` and `%TMP%` are discovered automatically; `$env:TEMP\openai-docs-cache` is a typical PowerShell override. The helper handles configured HTTP(S) proxies and falls back to `curl` when needed. Do not require a POSIX-only environment prefix or an unnecessary cache override.++The helper verifies the current source and returns a manual path, outline path, freshness status, and heading outline. Use that outline to locate relevant headings and line ranges, then read or search only the returned manual and outline paths. Do not inspect unrelated repositories, caches, source trees, or local state to establish a public Codex product claim.++For follow-up questions in the same thread, reuse those fresh paths instead of fetching again. If asked whether the manual is current enough to rely on now, rerun the helper when an allowed temp cache is available and answer from its reported status and returned paths.++## Fill only genuine documentation gaps++If the manual answers a claim, stop retrieving sources for that claim. Its official source pages and known anchors are sufficient citation support. Continue the user's broader task when the documentation lookup was only one dependency.++If the helper was legitimately skipped, actually fails, or the fresh manual lacks a material or likely-current claim, use the narrowest official follow-up. Search the exact topic using an available documentation or approved-domain web capability, then actually open or fetch a clearly relevant official result. A page-specific citation can justify the same narrow follow-up.++For an undocumented Codex term, mode, acronym, or exact error, first check adjacent manual terminology. Map it to the closest documented concept when possible. If the exact term is material or likely current, perform one targeted official search-and-fetch; if it remains undocumented, say so. Do not expand into internal knowledge bases, private source trees, guessed roadmap details, or account-specific workarounds.++If official documentation conflicts with a callable capability verified in the current session, explicitly state the conflict and prefer that verified behavior for this environment. Otherwise, resolve unsupported claims with bounded uncertainty or route the user to support, an administrator, or product feedback.++## Choose the smallest matching Codex surface++- Prompt or thread context: one-off task constraints.+- Repository `AGENTS.md`: durable team conventions, commands, and verification expectations; nested files apply more specifically within their subtree.+- Project `.codex/config.toml`: settings for a trusted repository, including sandbox, MCP, hooks, model, and reasoning defaults.+- Global config or global guidance: personal defaults across repositories.+- Skill: a reusable workflow, optionally with focused references or scripts.+- Plugin: an installable bundle of skills, tools, commands, MCP configuration, hooks, apps, assets, or related metadata.+- MCP server or app connector: authorized live external data and actions. Use an authenticated connector, not web search or memory, for private Google Docs, Calendar, Slack, GitHub, Notion, or similar workspace data.+- Automation: scheduled checks, reminders, monitors, or follow-ups; use an existing-thread heartbeat when continuity matters.+- Hook: mechanical enforcement around lifecycle events, tool calls, commands, or edits.++Split requests that combine one-off, durable, repository-scoped, and recurring behavior instead of forcing them onto a single surface. For example, "always do this, but only for this PR" belongs in the current prompt or thread unless the user explicitly wants persistence or enforcement.++For a surface recommendation, state what to use, why it fits, what to avoid, and the manual or official documentation supporting the answer.++For product surfaces, distinguish terminal-first CLI work, editor-attached IDE work, desktop planning or review, hosted cloud execution, in-app browser testing, the user's existing Chrome session, and desktop Computer Use. Keep `config.toml` defaults, `requirements.toml` constraints, and managed or administrator policy separate. An API key does not establish ChatGPT, Codex cloud, connector, or account access.++For plugin or app failures, check the installed bundle, enabled state, connector authorization, MCP setup, restart or new-thread expectations, and workspace policy before inferring a cause. Route billing, entitlements, undocumented rollout labels, and unsupported access paths to the appropriate support or administrative owner.++Memory can provide user preferences or context, but explicit prompt instructions win and memory is not a source for current external facts. Sandbox or network denials require narrowly scoped escalation with a clear justification; destructive commands, writes outside the workspace, and broad access changes require explicit approval.++When a page-specific citation helps, useful official anchors include `concepts/customization#agents-guidance`, `concepts/customization#skills`, `plugins/build#plugin-structure`, `concepts/customization#mcp`, `config-advanced#hooks`, `app/automations#thread-automations`, and `config-reference#configtoml`.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/latest-model.md b/codex-rs/skills/src/assets/samples/openai-docs/references/latest-model.mdindex b3b173d941..27d46ffd05 100644--- a/codex-rs/skills/src/assets/samples/openai-docs/references/latest-model.md+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/latest-model.md@@ -1,40 +1,25 @@-# Latest model guide+# Latest model fallback-This file is a curated helper. Every recommendation here must be verified against current OpenAI docs before it is repeated to a user.+This is a compact, non-authoritative fallback, not a source for current availability, prices, aliases, or defaults. First search for and fetch current official model guidance at `https://developers.openai.com/api/docs/guides/latest-model` and the relevant official model page. The fetched official documentation wins if this snapshot has drifted. Disclose any use of this fallback.-## Current model map+## GPT-5.6 family-| Model ID | Use for |+| Model ID | Documented workload to verify against the current model page || --- | --- |-| `gpt-5.6` | Latest/default GPT-5.6 alias; routes to Sol |-| `gpt-5.6-sol` | Flagship GPT-5.6 tier for hardest quality-first, coding, and reasoning workflows |-| `gpt-5.6-terra` | Mini-like GPT-5.6 tier for balanced cost, latency, and quality |-| `gpt-5.6-luna` | Nano-like GPT-5.6 tier for high-throughput, simple, or strict-latency tasks |-| `gpt-5.5` | Previous default text and reasoning model; use for existing GPT-5.5 integrations |-| `gpt-5.4` | Older default text and reasoning model; use for existing GPT-5.4 integrations |-| `gpt-5.4-mini` | Older lower-cost testing and lighter production workflows |-| `gpt-5.4-nano` | Older high-throughput simple tasks and classification |-| `gpt-4.1-mini` | Cheaper no-reasoning text |-| `gpt-4.1-nano` | Fastest and cheapest no-reasoning text |-| `gpt-5.3-codex` | Agentic coding, code editing, and tool-heavy coding workflows |-| `gpt-5.1-codex-mini` | Cheaper coding workflows |-| `gpt-image-2` | Best image generation and edit quality |-| `gpt-image-1.5` | Less expensive image generation and edit quality |-| `gpt-image-1-mini` | Cost-optimized image generation |-| `gpt-4o-mini-tts` | Text-to-speech |-| `gpt-4o-mini-transcribe` | Speech-to-text, fast and cost-efficient |-| `gpt-realtime-1.5` | Realtime voice and multimodal sessions |-| `gpt-realtime-mini` | Cheaper realtime sessions |-| `gpt-audio` | Chat Completions audio input and output |-| `gpt-audio-mini` | Cheaper Chat Completions audio workflows |-| `sora-2` | Faster iteration and draft video generation |-| `sora-2-pro` | Higher-quality production video |-| `omni-moderation-latest` | Text and image moderation |-| `text-embedding-3-large` | Higher-quality retrieval embeddings; default in this skill because no best-specific row exists |-| `text-embedding-3-small` | Lower-cost embeddings |--## Maintenance notes--- GPT-5.6 Pro is a Responses reasoning mode on the base model, not a separate `gpt-5.6-pro` slug. Verify the live model guide before recommending its request shape.-- This file will drift unless it is periodically re-verified against current OpenAI docs.-- If this file conflicts with current docs, the docs win.+| `gpt-5.6` | GPT-5.6 family alias; verify its currently documented routing and availability. |+| `gpt-5.6-sol` | Quality-first flagship, reasoning, and difficult coding work. |+| `gpt-5.6-terra` | Balanced quality, latency, and cost. |+| `gpt-5.6-luna` | High-throughput, lower-latency work. |++Use `https://developers.openai.com/api/docs/guides/upgrading-to-gpt-5p6-sol` for an actual GPT-5.6 migration and `https://developers.openai.com/api/docs/guides/prompt-guidance-gpt-5p6` for requested GPT-5.6 prompting. Open and read the relevant page before recommending a request shape, reasoning setting, endpoint, tool behavior, or migration.++## Explicitly requested existing models++| Model ID | Boundary |+| --- | --- |+| `gpt-4.1` | Preserve only when the user explicitly requests this model or existing migration target; search and fetch its own current official guide. |+| `gpt-5.4` | Preserve only when the user explicitly requests this model or existing migration target; search and fetch its own current official guide. |++Do not promote a legacy model as the current default, substitute it into an unrelated task, or replace an explicitly requested legacy target with GPT-5.6. Recommend a specialized image, audio, realtime, coding, moderation, or embedding model only after verifying the requested modality against current official documentation.++Verify GPT-5.6 Pro against current official Responses and model documentation before describing model IDs, reasoning modes, request parameters, or account availability; do not invent a separate `gpt-5.6-pro` model slug.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/mcp-diagnostics.md b/codex-rs/skills/src/assets/samples/openai-docs/references/mcp-diagnostics.mdnew file mode 100644index 0000000000..a49d0f2993--- /dev/null+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/mcp-diagnostics.md@@ -0,0 +1,27 @@+# Local documentation MCP setup and diagnostics++Use this route only when the user explicitly asks to configure or troubleshoot the official OpenAI documentation MCP server in a supported **local Codex client**. A missing documentation tool during an ordinary documentation request is not a setup request: answer with the root skill's official-domain web fallback without installation, sandbox escalation, configuration changes, or restart.++## Verify the supported local setup++1. Search and fetch current official Codex MCP setup documentation when those tools are callable. Otherwise, search and fetch the relevant official OpenAI documentation directly.+2. Confirm the documented endpoint is `https://developers.openai.com/mcp` and verify the supported command or configuration against that current documentation before recommending it.+3. When the current documentation supports it, the local Codex CLI setup is:++ ```sh+ codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp+ ```++ The equivalent documented configuration is:++ ```toml+ [mcp_servers.openaiDeveloperDocs]+ url = "https://developers.openai.com/mcp"+ ```++4. Check the supported local client's MCP listing or configuration, its enabled state, relevant workspace/admin policy, and any documented authentication requirement. Verify success from the actual command result, configuration, or a callable documentation-tool search/fetch; never claim installation or access without evidence.+5. Recommend a local-client restart or new local session only when current official documentation or observed client behavior requires it. Clearly identify which local client must refresh.++A skill dependency declaration, configured server, or local-client setup does not make a tool callable in an already running session. In particular, editing a hosted container's local configuration cannot install a tool into the host or model's current tool inventory. Never claim a local command installed the server into a current hosted session.++Only perform a local installation or configuration change when the user explicitly authorizes that change. Never request sandbox escalation, edit hosted configuration, install a dependency, or ask the user to restart a hosted session merely to answer an ordinary documentation question.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/model-migration.md b/codex-rs/skills/src/assets/samples/openai-docs/references/model-migration.mdnew file mode 100644index 0000000000..895fca9328--- /dev/null+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/model-migration.md@@ -0,0 +1,45 @@+# Model migration and prompting++Use this route for model upgrades, migration planning, model-specific prompting, or latest/current/default prompting guidance. First search current official OpenAI documentation for the exact requested topic and model, then open or fetch the relevant official page using an available documentation or official-domain web capability. Do not run a resolver, open bundled references, or rely on a guide URL before completing that official search and actual page fetch.++## Choose the target before loading more context++- **Explicit model target:** Preserve the user's exact requested target, including an explicitly requested GPT-4.1 or GPT-5.4 migration. Do not run the latest-model resolver and do not substitute a newer model. Search for and fetch current guidance for that exact model. A GPT-5.4 migration must not load GPT-5.6 guidance or references.+- **Unspecified, latest, current, or default target:** Search for and fetch `https://developers.openai.com/api/docs/guides/latest-model` first. Use the corresponding `latest-model.md` metadata only when dynamic migration resolution is needed, then run the platform-specific resolver below and preserve its returned model and exact guide URLs.+- **Latest/current/default prompting:** Follow the dynamic-target route, then use the returned prompting guide. Do not run the resolver for explicitly named-model prompting.+- **Pure model selection:** Use `references/model-selection.md` instead. Do not run the resolver.++For POSIX shells, invoke the resolver through `sh`, without assuming an executable bit:++```sh+sh <skill-dir>/scripts/resolve-latest-model-info+```++On Windows, use the CommonJS entry point with Node.js 18 or newer:++```text+node <skill-dir>\scripts\resolve-latest-model-info.cjs+```++If the Windows Node runtime is unavailable and `load_workspace_dependencies` is callable, use its returned runtime and retry once. Do not execute the extensionless POSIX wrapper directly on Windows.++Do not suppress or redirect resolver stdout. Success requires JSON with nonempty `model`, `migrationGuideUrl`, and `promptingGuideUrl` fields. If the command fails or any required field is missing, retry the platform-specific command once, then fall back to current official documentation and finally disclosed bundled references.++## Retrieve only the guidance this request needs++Treat returned guide URLs as opaque: fetch those exact URLs without deriving, substituting, or appending a model query. Use an available official documentation or first-party-domain capability to open and read the relevant official page. Retry the exact guide URL when its response contains only a title or no substantive body.++- Fetch `migrationGuideUrl` for a requested migration or upgrade plan.+- Fetch `promptingGuideUrl` only when the user asks for prompting guidance or the migration requires a prompt change. Extract only `## Prompting Best Practices` through the next H2 heading.+- For explicitly named-model prompting, fetch that model's official prompting guidance and extract only `## Prompting Best Practices` through the next H2 heading. Do not load a migration reference or run the resolver.+- For an actual GPT-5.6-family migration or implementation plan, fetch `https://developers.openai.com/api/docs/guides/upgrading-to-gpt-5p6-sol`. For specifically requested GPT-5.6 prompting, fetch `https://developers.openai.com/api/docs/guides/prompt-guidance-gpt-5p6`. Read `references/upgrading-to-gpt-5p6-sol.md` only when fetched official guidance does not resolve needed compatibility gates, scoped code changes, tier-aware routing, validation, or other migration-specific judgment. Never load it for documentation-only questions about model tiers, the family alias, Pro mode, reasoning effort, or current guidance when the fetched official documentation already answers them.+- Read `references/prompting-guide.md` only when prompting guidance or prompt changes are actually needed and current official guidance is unavailable.+- Read `references/upgrade-guide.md` only when current official migration guidance is unavailable. Disclose when a bundled fallback was used.++## Keep implementation changes scoped++Change active model defaults and directly related prompt surfaces only when the user requested that work. Update registries, model pickers, capability metadata, routing, pricing, or tests only when they are in scope and current official documentation verifies the relevant values.++Preserve each workload's cost, latency, quality, reasoning, tool, endpoint, and output-contract role. Do not collapse a tiered router into one flagship model, replace intentionally pinned fallbacks, or rewrite historical examples, fixtures, eval baselines, provider comparisons, or unrelated SDK and authentication configuration.++If a safe migration requires an endpoint change, request-schema change, tool-handler change, or other implementation outside the requested scope, report the exact compatibility blocker and smallest follow-up instead of silently changing behavior.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/model-selection.md b/codex-rs/skills/src/assets/samples/openai-docs/references/model-selection.mdnew file mode 100644index 0000000000..6ff3dfaeca--- /dev/null+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/model-selection.md@@ -0,0 +1,12 @@+# Model selection++Use this route for model recommendations, comparisons, and latest/current/default choices when the user is not requesting a migration or prompting guidance.++1. Search current official OpenAI documentation for the exact requested workload and any explicitly named model; then open or fetch the relevant official page. For current or latest family guidance, use `https://developers.openai.com/api/docs/guides/latest-model`.+2. Use any available official documentation or first-party-domain search. Read the actual source; do not make a recommendation from a search snippet, guessed default, or bundled snapshot.+3. Match the documented model to the user's requested modality, quality, latency, cost, context, and workload. Distinguish flagship, balanced, high-throughput, coding, audio, image, or other specialized roles only when the fetched current documentation supports the distinction.+4. Preserve an explicitly requested model or existing target. Cite the current official page and state uncertainty about availability, pricing, limits, or account access.++Pure model selection does not require migration metadata. **Do not run the resolver.**++Read `references/latest-model.md` only when fetched current official sources cannot answer the question. Disclose that bundled fallback guidance was used and may be outdated.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/official-docs.md b/codex-rs/skills/src/assets/samples/openai-docs/references/official-docs.mdnew file mode 100644index 0000000000..204e31ed99--- /dev/null+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/official-docs.md@@ -0,0 +1,25 @@+# Official documentation, API references, and ChatGPT Work++Use this route for OpenAI product or API documentation, examples, citations, ChatGPT Work, learning content, mixed Chat/Work/Codex comparisons, and narrow Codex product documentation. Follow the root skill's official-source order and credential boundary.++An explicit OpenAI documentation question stays documentation-first even when embedded in a broader repository, Promptfoo, agent-evaluation, `PLANS.md`, frontend, tool-use, image, Realtime API, SDK installation, or streaming-debugging task. Search the exact requested official documentation and open or fetch its relevant page before inspecting local files, drafting a plan, running evals, reading bundled references, or invoking the Codex manual. Then use the fetched official source to complete the requested work.++## Find the smallest useful source++1. Search the exact topic with a specific, title-like query containing 2-6 essential terms. Prefer an already-available direct official documentation search and page-retrieval capability; search, then fetch or open the best page or section. Otherwise, immediately use official-domain web search and actually open or fetch the result.+2. If the results are noisy, narrow the query. When a plausible official documentation URL is available, open or fetch the page instead of relying on search snippets. Use an already available documentation index only when there is no clear search query.+3. For API schemas, required fields, parameters, or endpoint shapes, use an already available OpenAPI or specification capability when it directly resolves the question. Otherwise verify the shape against the fetched official API guide or reference.+4. Cite the exact official page supporting each consequential claim. Keep examples minimal, paraphrase instead of quoting at length, and state when official sources do not establish a capability, parameter, price, or availability.++Preserve an explicitly requested model in the search and answer. Search the requested topic directly for model-specific frontend and tool-use prompting, image input or generation, Realtime voice or translation, official Agents SDK installation, Responses streaming errors, and Codex Goals. A specific Codex feature, error, setting, or requested citation is a narrow documentation lookup, not the broad manual-first exception. Current or latest model recommendations follow the model-selection route and the same official search-and-fetch order.++## ChatGPT Work and mixed surfaces++Treat a comparison between Chat, Work, and Codex as ChatGPT Work documentation, not broad Codex self-knowledge. Search `learn.chatgpt.com` and open or fetch the relevant official page. Useful starting pages are:++- `https://learn.chatgpt.com/docs/use-chatgpt`+- `https://learn.chatgpt.com/docs/get-started-with-work`++If someone simply asks an API question from ChatGPT Work, answer the API question from the relevant API guide. Being in Work does not make it a question about the Work product.++Separate documented user-facing purposes from unsupported claims about underlying models, hard capability boundaries, file or context inheritance, exact UI labels, account entitlements, and rollout availability. When those details cannot be verified, cite the closest allowed official source and state the uncertainty.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/prompting-guide.md b/codex-rs/skills/src/assets/samples/openai-docs/references/prompting-guide.mdindex 1b27f709d7..221a6d1133 100644--- a/codex-rs/skills/src/assets/samples/openai-docs/references/prompting-guide.md+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/prompting-guide.md@@ -1,27 +1,29 @@## Retrieve the live GPT-5.6 prompting guidance-Use the OpenAI Docs MCP to fetch the live GPT-5.6 prompting guidance from:+Use already-callable official documentation search and fetch, or immediately use official-domain web search and fetch, to retrieve the live GPT-5.6 prompting guidance from:https://developers.openai.com/api/docs/guides/model-guidance?model=gpt-5.6#prompting-best-practices-Read only the `## Prompting Best Practices` section, stopping at the next H2 heading. The URL anchor points to the section visually, but the Docs MCP may return the full page, so explicitly extract only that section.+Read only the `## Prompting Best Practices` section, stopping at the next H2 heading. The URL anchor points to the section visually, but a documentation fetch may return the full page, so explicitly extract only that section.Treat the live section as the canonical model-specific prompting guidance. Use the local guidance below only for skill-specific migration judgment: deciding what to preserve, remove, rewrite, or test when adapting an existing prompt stack to GPT-5.6.## Skill-specific migration judgment-GPT-5.6 works best when prompts define the outcome, important constraints, available evidence, and completion bar, then leave room for the model to choose an efficient path.+GPT-5.6 works best when prompts define the outcome, important constraints, available evidence, and completion bar, then leave room for the model to choose an efficient path. Compared with earlier GPT-5 models, many applications can use shorter prompts and smaller tool sets without losing quality.-Removing repeated instructions and examples and simplifying tool descriptions can improve task performance and token efficiency. In a sample of internal coding-agent eval runs, configurations with leaner system prompts improved evaluation scores by roughly 10–15% while reducing total tokens by 41–66% and cost by 33–67%. Results will vary by workload, so treat these ranges as directional and validate changes on representative tasks from your own application.+Do not carry over every instruction from an older prompt stack. Legacy prompts often repeat rules, prescribe unnecessary steps, expose irrelevant tools, or include examples that no longer change behavior. With GPT-5.6, this can encourage extra exploration, repeated validation, and larger accumulated context.++Start with the smallest prompt and tool set that passes your evals. Add an instruction, example, or tool only when it fixes a measured failure mode.## Simplify prompts first-Start with a prompt and tool set that already works. Remove one group of instructions, examples, or tools at a time, then rerun the same evals.+When migrating an existing prompt, remove redundant scaffolding before adding new GPT-5.6-specific instructions.Trim:- repeated statements of the same rule;-- repeated style or process instructions that do not change behavior;+- generic “be thorough,” “be concise,” or “think step by step” language;- examples that do not change behavior;- process instructions for behavior the model already performs reliably;- tools and tool descriptions unrelated to the task.@@ -31,7 +33,7 @@ Keep:- the user-visible outcome;- success criteria and stopping conditions;- safety, business, evidence, and permission constraints;-- tool-routing rules when the route depends on context;+- tool-routing rules when the correct route is not obvious;- required output shape and validation requirements.Review the remaining instructions for contradictions. GPT-5-class models follow prompt contracts closely, so conflicting rules can create more instability than missing detail.@@ -66,32 +68,26 @@ Add stopping conditions:## Personality, collaboration, and response length-GPT-5.6 tends to be more concise by default than GPT-5.5. When migrating, check whether broad brevity instructions such as “Be concise” or “Keep it short” are still useful. They may be unnecessary for some tasks and can sometimes make responses too brief. Keep them when they reliably produce the output your application needs.--For more consistent control across requests, use `text.verbosity` to set the default level of detail, then use the prompt for task-specific requirements. Choose `low`, `medium`, or `high` as the default level of detail for a request. In the prompt, specify any task-specific length, structure, or required content. See [Set up `text.verbosity`](https://developers.openai.com/api/docs/guides/deployment-checklist#set-up-textverbosity) for an API example.--For customer-facing assistants and collaborative products, define both personality and collaboration style.+GPT-5.6 is efficient, direct, and more compressed than recent models. For customer-facing assistants and collaborative products, define both personality and collaboration style.- Personality controls tone, warmth, directness, formality, humor, empathy, and polish.- Collaboration style controls when the model asks questions, makes assumptions, takes initiative, explains tradeoffs, checks work, and handles uncertainty.Keep both short. Personality should shape the user experience; collaboration instructions should shape task behavior. Neither should replace clear goals, success criteria, tool rules, or stopping conditions.-When a task calls for a shorter answer, identify the information the model must preserve and the detail it can omit. For example:+Use concrete writing controls:- Lead with the conclusion. Include the evidence needed to support it, any material- caveat, and the next action. Omit secondary detail and repetition.+ Lead with the conclusion. Include the evidence needed to support it, any+ material caveat, and the next action. Keep all required facts, decisions,+ caveats, and next steps. Trim introductions, repetition, generic reassurance,+ and optional background first.- Keep all required facts, decisions, caveats, and next steps. Trim introductions,- repetition, generic reassurance, and optional background first.+Avoid generic “be brief,” “keep it short,” or “use minimal text” instructions. GPT-5.6 is already biased toward compression, and generic brevity can make it omit required evidence or parts of an artifact.-This gives the model a clear priority order: preserve the content needed to complete the task, then remove lower-value detail.+For customer-facing tone, prefer concrete guidance:-Broad labels such as “friendly” or “empathetic” can be ambiguous. Describe the writing choices that define your product's tone, such as how directly to state the answer, when to acknowledge a problem, and whether reassurance or a sign-off is appropriate.-- State the answer directly. If the user reports a problem, acknowledge the- specific issue before giving the next step. Use reassurance only when it is- relevant. Omit generic praise and unnecessary sign-offs.+ Be direct and tactful. Acknowledge friction specifically when relevant.+ Avoid canned reassurance and unnecessary sign-offs.Avoid blanket language rules such as “always respond in the user's language” unless that is truly the product requirement. Specify the intended output language and when it should change.@@ -101,11 +97,9 @@ For editing, rewriting, summaries, and customer-facing drafts, tell the model whfirst. Improve clarity, flow, and correctness without adding new claims,sections, or a more promotional tone unless requested.-## Define autonomy and approval boundaries--GPT-5.6 can be proactive and persistent when carrying out multi-step tasks. Define what level of action each request authorizes so the model can continue safe, in-scope work without unnecessary pauses while stopping before external, destructive, costly, or scope-expanding actions.+## Autonomy and permissions-A compact policy is usually sufficient:+GPT-5.6 can be proactive and persistent. Define which level of action each request authorizes.For requests to answer, explain, review, diagnose, or plan, inspect therelevant materials and report the result. Do not implement changes unless@@ -117,7 +111,9 @@ A compact policy is usually sufficient:Require confirmation for external writes, destructive actions, purchases,or a material expansion of scope.-Name safe local actions explicitly, such as reading files, inspecting logs, editing in-scope code, and running tests. Keep the policy in one place and state each rule once. Repeating instructions such as “ask first,” “do not mutate,” or “wait for approval” can cause unnecessary approval requests for safe, expected actions.+Specify which local actions are safe without approval, such as reading files, inspecting logs, searching, editing in-scope code, and running non-destructive tests.++Avoid repeating “ask first” throughout the prompt. Repetition can cause unnecessary permission checks even for safe, expected actions.For long-running work, define the current layer of work. Distinguish research, design, implementation, review, and external coordination so the model does not silently move from one layer to another.@@ -137,9 +133,7 @@ If a tool returns empty, partial, or suspiciously narrow results, try one or two## Programmatic Tool Calling-Programmatic Tool Calling (PTC) works best for bounded workflows where code can process several tool results or large intermediate outputs and return a much smaller structured result.--Multiple, parallel, or dependent calls alone do not justify Programmatic Tool Calling.+Programmatic Tool Calling is useful when code can reduce large, structured intermediate results before they return to model context.Use it for:@@ -165,11 +159,7 @@ Do not rely on generic instructions such as “use Programmatic Tool Calling effevidence fields. Retry transient failures at most twice. Use direct toolcalls for approval, semantic judgment, citations, and final validation.-If both routes are needed, define one clear handoff and tell the model not to switch routes or repeat completed work.--The `program_output` item and final assistant `message` are separate outputs; make sure to test both. In theory, a program can return the correct records while the message omits a required field, citation, or caveat.--Compare direct and programmatic calling on the same representative tasks. Check whether the final response is correct, complete, and includes the required evidence. Then compare total tokens, latency, cost, calls, turns, and retries. Count lower resource use as an improvement only when the response still passes your existing evals.+Evaluate the final user-visible answer, not only the program result. Lower tokens, latency, calls, or turns are improvements only when the final answer still meets the required quality bar.## Grounding, citations, and retrieval budgets@@ -216,7 +206,7 @@ Prompt caching also affects prompt construction. Keep reusable prefixes stable a## Reasoning effort-Establish a baseline with the current reasoning effort before changing it.+Treat reasoning effort as a last-mile tuning knob, not the first response to a weak result.- Preserve the current GPT-5.5 or GPT-5.4 reasoning effort as the baseline.- Test the same setting and one level lower on representative tasks.diff --git a/codex-rs/skills/src/assets/samples/openai-docs/references/upgrading-to-gpt-5p6-sol.md b/codex-rs/skills/src/assets/samples/openai-docs/references/upgrading-to-gpt-5p6-sol.mdindex d173f05b27..43f506fce6 100644--- a/codex-rs/skills/src/assets/samples/openai-docs/references/upgrading-to-gpt-5p6-sol.md+++ b/codex-rs/skills/src/assets/samples/openai-docs/references/upgrading-to-gpt-5p6-sol.md@@ -4,7 +4,7 @@ Use this guide when the user asks to migrate an existing OpenAI API integration,The default explicit target is `gpt-5.6-sol`. The alias `gpt-5.6` routes to Sol; use it only when the repository intentionally prefers family aliases. Do not treat every old model usage as a Sol candidate: GPT-5.6 is a family with different cost, latency, context, and quality roles.-Before changing code, use the OpenAI Docs MCP to fetch the current live GPT-5.6 model guidance:+Before changing code, retrieve the current live GPT-5.6 model guidance using already-callable official documentation search and fetch, or immediately use official-domain web search and fetch:https://developers.openai.com/api/docs/guides/model-guidance?model=gpt-5.6@@ -302,7 +302,7 @@ If migrating a legacy Pro slug, make the mode change explicit and evaluate it se## Optional: Programmatic Tool Calling-Programmatic Tool Calling is not a required part of moving to GPT-5.6. Consider it for bounded workflows where code can process several tool results or large intermediate outputs and return a much smaller structured result. Multiple, parallel, or dependent calls alone do not justify it.+Programmatic Tool Calling is not a required part of moving to GPT-5.6. Add it only when code can reduce large structured intermediate results before they return to model context.Good candidates:@@ -336,7 +336,7 @@ Request-shape requirements:Do not nest `programmatic_tool_calling` under another `tools` property. When enabled, the host must handle `program`, program-issued `function_call`, `function_call_output`, and `program_output` items. Preserve the original `call_id` and `caller` when returning function results.-Constrain the stage, eligible read-only tools, output schema, retry limit, and handoff back to direct judgment. Test both the `program_output` item and final assistant `message`; a program can return the correct records while the message omits a required field, citation, or caveat.+Constrain the stage, eligible read-only tools, output schema, retry limit, and handoff back to direct judgment. Validate the final user-visible answer; a correct program result can still become an incorrect final answer.## Optional: multi-agent beta@@ -359,21 +359,20 @@ After the model and API baseline is working, run representative traces before edFor GPT-5.6, prefer:-- leaner, outcome-oriented prompts that remove repeated scaffolding while preserving product requirements;+- shorter, outcome-oriented prompts;- explicit success criteria, dependencies, stopping conditions, and completion boundaries;- preserved user-provided values;- decision criteria for implicit choices instead of universal defaults or keyword maps;- explicit autonomy and permission boundaries;- explicit tool routing, resource links, breadcrumbs, and expected tool choice;-- `text.verbosity` for the default level of detail, with prompt instructions for required task-specific content;- staged plans, current-layer awareness, and concise handoffs for long work;- real validation before declaring completion.Avoid:-- untested generic style or process instructions that do not change measured behavior;+- generic `be brief`, `be thorough`, or `think step by step` instructions;- blanket language instructions that can cause unwanted language switching;-- repeating approval warnings throughout the prompt instead of keeping one clear autonomy policy;+- repeating `ask first` until safe local work becomes blocked;- giant prompt rewrites that make the source of a regression impossible to identify;- telling the model to minimize tool loops when correctness, evidence, or required validation needs more work.