Skip to content

Surface the offered tool + skill/slash-command catalog in the --json event stream #31088

Open

Description

@geserdugarov

What variant of Codex are you using?

CLI (codex exec --json), with equivalent app-server support requested.

What feature would you like to see?

Emit a bounded event describing the effective tools and skills offered to the model, through both CLI JSONL and app-server notifications.

Wrappers can observe tool usage through item.* events, but cannot distinguish capabilities that were unavailable, filtered out, or omitted by budgeting from those offered but never used.

The catalog should contain:

  • Tools: built-in, hosted, dynamic, extension/plugin, and MCP tool identities, using effective wire namespaces/names. Include provenance and exposure through direct calls, deferred tool search, Code Mode, or multiple surfaces.
  • Skills: identities retained in model context after enablement, plugin/environment filtering, and shared budgeting across host, executor, and orchestrator sources. Include source/scope and distinguish duplicate names.

Current behavior

Originally reported with codex-cli 0.142.5; source-rechecked on 2026-09-18 at 7498521d28, since 6be2a6ca95. This latest check is a source audit.

  • CLI thread.started carries only thread_id; turn.started is empty. Neither stream exposes the effective catalog.
  • skills/list and mcpServerStatus/list provide separate discovery/inventory views. skills/changed only signals invalidation. These do not identify the catalog used by a particular model request.
  • Internal tool_namespaces_info is opt-in Responses Lite metadata, omits skills and hosted web search, and is not a public lifecycle event.

Event contract

  1. Emit the initial catalog after tool planning and final skill rendering, before the first sampling request in each turn. Existing thread/turn-start events occur too early.
  2. Emit updates when the effective catalog changes. Include the captured model and a stable catalog_id or revision; reflect active policy, including allowlists and exposure restrictions, rather than pending settings.
  3. Associate usage with the originating request/catalog. Yielded Code Mode cells can outlive their turn (#44866), so delayed calls/results cannot simply use the latest catalog event.
  4. Provide consistent CLI and app-server projections while preserving existing event meanings and fields.

The captured StepContext and finalized ToolRouter provide a starting point (#44242, #45248). For skills, the renderer would need to preserve retained identities alongside its existing text and aggregate counts.

Illustrative event

Proposed CLI shape; event naming and request/call correlation need maintainer agreement:

{
  "type": "turn.catalog.updated",
  "thread_id": "…",
  "turn_id": "…",
  "catalog_id": "…",
  "model": "…",
  "tools": [
    {
      "namespace": "functions",
      "name": "exec_command",
      "source": { "kind": "harness" },
      "exposure": { "direct": true, "deferred": false, "code_mode_name": null }
    },
    {
      "namespace": "example_mcp",
      "name": "search",
      "source": { "kind": "mcp", "server": "example_mcp" },
      "exposure": { "direct": false, "deferred": true, "code_mode_name": "example_mcp_search" }
    },
    {
      "namespace": null,
      "name": "web_search",
      "source": { "kind": "hosted" },
      "exposure": { "direct": true, "deferred": false, "code_mode_name": null }
    }
  ],
  "skills": [
    {
      "id": "…",
      "name": "develop",
      "source": { "kind": "host", "scope": "repo" }
    },
    {
      "id": "…",
      "name": "review",
      "source": { "kind": "orchestrator" }
    }
  ],
  "skills_report": {
    "total_count": 2,
    "included_count": 2,
    "omitted_count": 0,
    "descriptions_truncated": false
  }
}

Skill counts describe eligible entries before and after catalog budgeting, not all installed skills.

Constraints

  • Emit identity/provenance metadata only: no schemas, descriptions, skill bodies, credentials, or sensitive configuration.
  • Bound payload size and explicitly distinguish event truncation from skills omitted from model context. Missing data must not appear as a complete empty catalog.
  • Preserve human-readable output and model behavior.
  • Keep TUI slash commands, detailed budget utilization, skill-invocation events, and analytics ingestion outside this request.

Activity

  1. added
    enhancement
    on Jul 4, 2026
  2. added
    CLI
    exec
    app-server
    skills
    mcp
    on Jul 4, 2026
  3. rovboyko commented on Jul 4, 2026

    @rovboyko

    Very useful functionality especially for orchestrating for role-based harnesses. Nice to have this in the CLI.

  4. geserdugarov commented on Jul 6, 2026

    @geserdugarov
    Author

    @jif-oai @bolinfest @etraut-openai would you be willing to sanity-check the proposed event shape here? It crosses skills/MCP catalog discovery, codex exec --json, and app-server stream parity.

  5. geserdugarov commented on Jul 20, 2026

    @geserdugarov
    Author

    Rechecked against openai/codex main at bf3c197 (2026-07-20): this is still not implemented in the requested form.

    Current state:

    • codex exec --json still defines thread.started with only thread_id, and its JSONL mapper copies only that field from SessionConfiguredEvent.
    • App-server's thread/start / thread/started payloads likewise contain no effective tools or skills catalog.
    • There are partial out-of-band APIs (skills/list and thread-scoped mcpServerStatus/list), but they do not solve stream observability: the former is cwd-scoped, the latter covers only MCP inventory, and neither provides the unified set of built-in/MCP/dynamic tools plus skills or commands actually offered to the model.

    Therefore, a JSONL consumer still cannot calculate “offered → used” without independently reconstructing Codex's discovery and configuration logic.

    One relevant implementation detail is that SessionConfigured is emitted before MCP initialization, so the earliest thread.started may be too early for the negotiated catalog. A dedicated additive event after catalog resolution and before the first turn - such as session.catalog or turn.configured - may therefore be more accurate than extending thread.started.

    Before I prepare an implementation, I need explicit maintainer confirmation that this contribution is wanted and agreement on the public event contract.

    @pakrym-oai, since you introduced the current thread.started JSON event shape, could you please confirm:

    1. Would a PR implementing this functionality be welcome?
    2. Should this extend thread.started, or use a dedicated post-initialization event?
    3. Should the catalog be session-scoped or turn-scoped, considering MCP refreshes and dynamic tools?
    4. Should the first PR cover both codex exec --json and app-server parity?

    If you are not the appropriate owner, could you point me to whoever should approve the direction? I’ll wait for that confirmation before starting implementation.

  6. geserdugarov commented on Aug 19, 2026

    @geserdugarov
    Author

    Rechecked against openai/codex main at 3929c99a97 (2026-08-19). This request is still not implemented.

    Current public surfaces:

    • codex exec --json still has no catalog/configured event. thread.started contains only thread_id; the mapper and its focused test still assert exactly that shape.
    • App-server's thread/start response and thread/started notification expose thread/session metadata but no effective tools, skills, or slash-command catalog.
    • skills/list and thread-scoped mcpServerStatus/list remain separate out-of-band inventories. They do not identify the unified catalog actually offered to the model for a particular turn.

    One relevant change since bf3c197 is #37492 (2b1811e562), which builds opt-in per-turn tool_namespaces_info for Responses Lite metadata from the effective tool registry. It records model-visible function exposure and harness/MCP ownership, but it is not emitted through codex exec --json or app-server, does not cover skills, and is not the complete requested catalog.

    The current lifecycle points more strongly toward a turn-scoped event: SessionConfigured is still emitted before initialized MCP bindings are published, while both the effective skill snapshot and effective tool router are resolved per turn. A dedicated additive event after that resolution, such as turn.configured, would therefore be more accurate than extending the early thread.started.

    The issue remains current. Maintainer guidance is still needed on the public event contract and whether CLI JSONL and app-server parity should land together.

  7. geserdugarov commented on Aug 19, 2026

    @geserdugarov
    Author

    @rka-oai, since you introduced the effective per-turn tool namespace inventory in #37492, could you sanity-check whether exposing a bounded projection of it through codex exec --json and app-server would be an acceptable public contract, and whether such a PR would be welcome?

    @felixxia-oai, for the skills portion, is the per-turn host skills snapshot the authoritative source for the skill names actually offered to the model?

    If either of you is not the appropriate owner, a pointer to the right person would be greatly appreciated.

  8. TyceHerrman commented on Aug 27, 2026

    @TyceHerrman

    There is no supported interface that confirms the effective budget, utilization, or whether rendering shortened or omitted anything.

    #35597 added useful catalog metrics:

    • codex.thread.skills.enabled_total
    • codex.thread.skills.kept_total
    • codex.thread.skills.description_truncated_chars
    • codex.thread.skills.truncated

    #37149 extended metrics and shared budgeting across executor, orchestrator, and host catalogs. However, these primarily reveal pressure after descriptions have already been shortened or entries omitted. They do not expose the untrimmed catalog cost or percentage of the allowance currently used.

    Could the proposed per-turn catalog event include the renderer’s effective report, for example:

    "skill_catalog_render": {
      "budget_unit": "tokens",
      "budget_limit": 21000,
      "untrimmed_size": 5600,
      "budget_fraction_used": 0.267,
      "total_count": 87,
      "included_count": 87,
      "omitted_count": 0,
      "truncated_description_chars": 0,
      "catalog_surfaces": [
        "executor_world_state",
        "orchestrator_world_state",
        "host_world_state"
      ]
    }
    

    This should ideally be emitted after the final per-turn catalog is resolved. That would let Desktop, CLI, hooks, and external dashboards warn at a chosen threshold without independently recreating Codex’s discovery, priority, tokenization, and rendering logic.

  9. geserdugarov commented on Aug 28, 2026

    @geserdugarov
    Author

    Thanks - this is adjacent, but I’d prefer to keep #31088 focused on exposing the effective per-turn tool/skill/command identities for offered-to-used analysis. A small omission/truncation indicator may fit, but detailed budget and utilization reporting seems better suited to a separate follow-up and shouldn’t block the core catalog event.

  10. geserdugarov commented on Aug 28, 2026

    @geserdugarov
    Author

    Rechecked against openai/codex main at 6be2a6ca95 (2026-08-28). The public gap remains: neither codex exec --json nor app-server lifecycle events expose the effective tool and skill catalog.

    A relevant change since the previous audit is #41195: the finalized tool plan now lives on the request-scoped StepContext, including model-visible specifications, Code Mode names, and optional namespace inventory. This provides a clearer authoritative source, but it remains internal, does not cover the final budgeted skill identities, and the existing namespace projection omits hosted web search.

    I updated the issue description to frame this as a bounded, request-scoped catalog event emitted after resolution and before model sampling, with another event when the effective catalog changes. Detailed budget utilization remains out of scope; a small omission or truncation indicator is sufficient.

  11. geserdugarov commented on Sep 18, 2026

    @geserdugarov
    Author

    Source-rechecked at 7498521d28 on 2026-09-18, comparing against 6be2a6ca95. The effective tool/skill catalog is still absent from codex exec --json and app-server lifecycle notifications. This was a source/protocol audit.

    The main changes relevant to this proposal:

    • #44242 and #45248 align tool planning and inventory metadata with the issuing step's captured settings and finalized ToolRouter. tool_namespaces_info remains internal, Responses Lite-specific, and incomplete for this request: it omits skills and hosted web search.
    • #44866 preserves the originating context of yielded Code Mode cells across turns. Late calls/results therefore need attribution to their originating catalog; matching them to the latest catalog event is insufficient.
    • Startup allowlists (#45711), per-app exposure restrictions (#46035), and captured environment policy (#46335) reinforce the need to report finalized, effective state.
    • Apps catalog refreshes now reach existing threads (#43900), and orchestrator skill caches track connection/invalidation changes (#46033). The event must account for catalog changes after startup.

    The proposed scope remains a bounded identity/provenance event before sampling, updated when the catalog changes, with CLI/app-server parity. Skills must reflect the identities retained after filtering and budgeting. Detailed budget utilization and skill-invocation instrumentation remain separate work.

  12. geserdugarov commented on Sep 18, 2026

    @geserdugarov
    Author

    @abhinav-oai, your request-inventory work in #45248 seems relevant here. Wrappers can observe tool calls, but cannot distinguish unavailable tools/skills from those offered but unused. A bounded catalog event in codex exec --json and app-server would support capability debugging and offered→used analytics without duplicating Codex's discovery logic.

    Would a PR be welcome? Could you advise on the event contract or point me to the right owner?

  13. Ksstewart1 commented on Sep 18, 2026

    @Ksstewart1

    Pinned Codex0.154.0 App Server over private stdio still lacks a complete effective-tool inventory readback. The generated protocol, server/diagnostics, thread/read, config/read and mcpServerStatus/list expose partial state only. The tool_registry.turn_metadata_includes_tool_info flag is conditional on use_responses_lite in finalize_tool_router; GPT-5.5 currently has use_responses_lite=false. debug prompt-input returns prompt.input, not the finalized tool catalog. Examined0.155.0 ClientRequest/prompt-debug source also does not establish a replacement interface.

    Could maintainers identify a supported read-only, session-bound way to obtain the complete finalized inventory BEFORE model sampling, or the smallest upstream change providing it? Our gate must include built-in, hosted, dynamic, MCP/plugin and deferred capabilities, effective wire names/provenance/exposure, model and originating context/catalog identity, and explicit completeness/truncation state. An empty or partial catalog must not count as complete. A prepare-only diagnostic path should use the same captured context and finalized ToolRouter as execution, with changes invalidating the snapshot. It must not require enabling Code Mode, changing authentication, proxying service traffic or logging credentials. This is a request for a supported capability, not a claim that the requested interface exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIapp-serverenhancementexecmcpskills

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions