Repository navigation
fix: start the title thread with the configured MCP servers disabled - #661
Open
Pearcekieser wants to merge 1 commit into
Open
Pearcekieser wants to merge 1 commit into
Pearcekieser wants to merge 1 commit into
Conversation
This was referenced Oct 22, 2026
Open
This branch has not been deployed
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.
Problem
TitleGenerator.generateAndPersiststarts its ephemeral thread withthreadStart({cwd, ephemeral: true})and noconfig. Codex then loads the user's config.toml and starts every server in[mcp_servers]for that thread. The title turn uses an output schema and no tools, so those processes do nothing. A user with ten configured servers pays ten extra processes per titled session.#629 releases the title thread after the turn, so these processes exit 60 s later instead of living until codex-acp exits. It does not stop them from starting. This PR is the other half and does not depend on #629.
Change
thread/start,TitleGeneratorreads the effective config for the session's cwd withconfig/readand passesconfig: {mcp_servers: {<name>: {enabled: false}, ...}}for every configured name.config/readfails, the thread starts as before, with noconfig. Title generation stays best-effort.mcp_servers: {}disables nothing. Disabling a name no layer defines fails the wholethread/startwithinvalid transport in mcp_servers.<name>, so a hard-coded list or a union of all layers would be unsafe.Tests
TitleGenerator.test.ts: the title thread is started with each configured server disabled, with noconfigwhen none is configured, and with noconfigwhenconfig/readfails. The first test fails without the change.npm run typecheckandnpm run buildpass.npm test: 1869 passed, 36 skipped, 1 failed. The failure isJsonSnapshot.test.ts > leaves values nested thousands deep to JSON.stringify, which fails the same way onmain(636b082) on this host.session/newwith a session MCP server, one prompt andsession/close:In every run the main thread's servers started and stopped the same way, 60 s after
session/close.codex app-serverprobe ofthread/start {ephemeral: true}with 2 configured servers: noconfigstarted 2,{"mcp_servers": {}}started 2, nested{name: {enabled: false}}started 0, the dottedmcp_servers.<name>.enabledform started 0, and an undefined name failedthread/startwith-32600.Related to #628 and #629.