fix(codex): bridge app-server tool-progress to the gateway (#38835) - #50226
Merged
Merged
Conversation
…ogress (#38835) When the main provider is the Codex app-server runtime (api_mode codex_app_server), the gateway showed no verbose 'running X' tool-progress breadcrumbs on Telegram while every other provider did. The app-server session processes item/started notifications (command execution, file changes, MCP/dynamic tool calls) but never surfaced them as Hermes tool-progress events — the session was constructed without an on_event hook, so the agent's tool_progress_callback was never invoked on this route. Add _codex_note_to_tool_progress() mapping item/started → (tool_name, preview, args) for commandExecution / fileChange / mcpToolCall / dynamicToolCall, and wire an on_event hook into CodexAppServerSession that forwards mapped events to agent.tool_progress_callback('tool.started', ...) — the same signature the chat_completions path uses (tool_executor.py). Non-tool items (agentMessage/reasoning) and non-item/started methods map to None and are ignored. Co-authored-by: jplew <462836+jplew@users.noreply.github.com>
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
not-subscriptable |
1 |
not-iterable |
1 |
First entries
tests/run_agent/test_codex_app_server_integration.py:515: [not-subscriptable] not-subscriptable: Cannot subscript object of type `None` with no `__getitem__` method
tests/run_agent/test_codex_app_server_integration.py:508: [not-iterable] not-iterable: Object of type `None` is not iterable
✅ Fixed issues: none
Unchanged: 5925 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
Contributor
|
Related: #38835 (the issue this fixes), #38836 (@jplew's PR this salvages the tool-progress bridge from), #26541 (earlier competing attempt to surface codex app-server tool calls), #33200 (Discord variant of the same silent-progress gap). This core-team salvage provides the focused |
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On the Codex app-server runtime (
api_mode codex_app_server), the gateway now shows verbose "running X" tool-progress breadcrumbs on Telegram (and other platforms), matching every other provider. Previously this route was silent until the final answer (#38835).Root cause: the Codex app-server session processes
item/startednotifications (command execution, file changes, MCP/dynamic tool calls), but the session was constructed without anon_eventhook — so the agent'stool_progress_callbackwas never invoked on this route. Other providers fire it fromtool_executor.py.Changes
agent/codex_runtime.py: add_codex_note_to_tool_progress()mapping anitem/startednotification →(tool_name, preview, args)forcommandExecution/fileChange/mcpToolCall/dynamicToolCall(returns None for non-tool items likeagentMessage/reasoning). Wire anon_eventhook intoCodexAppServerSessionthat forwards mapped events toagent.tool_progress_callback("tool.started", name, preview, args)— the exact signature the chat_completions path uses.tests/run_agent/test_codex_app_server_integration.py:TestCodexToolProgressBridge— mapper coverage for all 4 item types + non-tool/other-method rejection, plus an integration test that the session is wired with anon_eventhook that firestool_progress_callbackon a realitem/startednote.Validation
The session's notification loop already invokes
on_event(note)for every notification (codex_app_server_session.py:537); the construction site just never passed one. Verified the integration test fails without theon_eventwiring and passes with it. 22 passing in the codex integration suite.Scope note
Salvaged the tool-progress bridge from @jplew's PR #38836. That PR also bundled an unrelated
last_reasoninggateway-display addition — dropped here to keep this focused on #38835; it can land separately if wanted.Credit
Authorship preserved via co-author trailer; #38836 closes pointing here.
Infographic