MCP session logging, notification handling, and safer shutdown/stdio lifecycle#25
Draft
MCP session logging, notification handling, and safer shutdown/stdio lifecycle#25
Conversation
Set codex_mode to mcp-server in bundled Codex agents.
Decision-only step; no tracked changes.
Document stdio framing, tools schema, and event shapes from codex mcp-server.
Decision-only step; no tracked changes.
Decision-only step; no tracked changes.
Default codex_mode for codex agents and validate allowed values.
Introduce a stdio-backed PtyFactory with a round-trip test.
Translate line-buffered input into MCP tool calls with tests.
Select MCP vs PTY paths and adjust tests for default MCP mode.
Send codex-notify signals after MCP turns with workflow-aware handler.
Wait for MCP initialization before prompt injection and add coverage.
Add MCP-focused WebSocket and agent input coverage with a fake MCP server.
Document MCP transcript output and workflow notify handling.
Submit MCP turns on CR and allow LF inside prompts.\nNormalize REST MCP input to append CR and force blocking output.\nAdd tests for multiline prompts and MCP send-input.
Convert LF to CRLF in MCP transcript output so xterm starts lines at column zero.\nAdd test coverage for CRLF normalization.
Implement a lightweight text buffer with CR normalization and tests.
Render session output in a scrollable text component and wire output to a text store.
Ensure cached session history populates the terminal text buffer on connect.
Render session output as segmented prompt/output spans with tests for segment assembly.
Remove xterm-specific wiring from the terminal service and socket callbacks.
Drop xterm canvas/helpers and clean terminal history test.
Add scrollback/font settings to status and use them in the frontend.
Treat \r as line reset in terminal buffers and tests.
Cover at-bottom notifications for the lightweight terminal view.
Refresh terminal UI references after removing xterm.
Skip echoed command lines in terminal output.
Show Temporal and Bottom buttons in the session header.
Drop the input-area scroll button now that the header owns it.
Allow dragging the input top edge to adjust its height.
Hide the textarea scrollbar until content overflows.
Expose session input font settings in status and apply them in the UI.
Use dynamic viewport sizing and safe-area padding so session headers and input stay visible.
Handle notifications outside response waits and cover idle output.
Always render MCP notifications with codex/event parsing and truncation.
Note that meta fields are omitted from console output.
Verify notifications between request/response still yield output.
Document notification formatting in codex MCP notes.
Add a new L1 with L2 tasks for non-ID payload fields.
Add the session config key and tests for its default and overrides.
Stop rendering MCP notifications in terminal output and persist them to per-session event logs when enabled.
Log a warning when codex event logging is enabled without a session log directory.
Mark the plan items complete after implementing event logging changes.
Centralize shutdown phase order and add coverage for sequence execution.
Use notify contexts and log repeated signals while keeping graceful shutdown.
Enforce per-phase and total shutdown deadlines with timeout coverage.
Track pid/pgid and terminate process trees with graceful timeouts.
Add manager CloseAll and wire session shutdown into the coordinator.
Track background processes and stop any leftovers during shutdown.
Exercise shutdown phase ordering to keep OTel and Temporal sequencing stable.
Document shutdown behavior and acceptance checks.
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.
This branch improves MCP session observability and shutdown safety, and tightens stdio MCP process handling.