Skip to content

feat(mcp): expose Codex identity metadata to tools#80

Open
richardgetz wants to merge 1 commit into
stablefrom
codex/for-human-contract
Open

feat(mcp): expose Codex identity metadata to tools#80
richardgetz wants to merge 1 commit into
stablefrom
codex/for-human-contract

Conversation

@richardgetz

Copy link
Copy Markdown
Owner

Summary

  • add nested _meta.codex identity metadata (threadId, sessionId, cwd) to model-invoked MCP tool calls
  • add the same identity envelope to direct app-server MCP tool calls while preserving legacy flat _meta.threadId
  • cover the contract with core unit tests and an app-server MCP suite assertion

Verification

  • PATH=/tmp/codex-tools/bin:$PATH UV_CACHE_DIR=/tmp/codex-uv-cache CARGO_HOME=/tmp/codex-cargo-home just fmt
  • PATH=/tmp/codex-tools/bin:$PATH CARGO_HOME=/tmp/codex-cargo-home just test -p codex-core mcp_tool_call_codex_meta
  • PATH=/tmp/codex-tools/bin:$PATH CARGO_HOME=/tmp/codex-cargo-home just test -p codex-app-server mcp_server_tool_call_returns_tool_result
  • PATH=/tmp/codex-tools/bin:$PATH CARGO_HOME=/tmp/codex-cargo-home just fix -p codex-core
  • Companion For Human local contract tests: npm test

Review

  • Independent post-change review ran with two reviewers.
  • First reviewer found no issues.
  • Second reviewer found two P1 contract issues: shared Codex session ids could collapse descendant threads in For Human, and cwd could be empty when no single local environment was selected.
  • Fixed both issues in the companion For Human local tree and Codex metadata cwd fallback.
  • Follow-up independent review found no remaining issues.

Notes

  • This keeps Codex generic: no For Human-specific code paths are added.
  • The companion For Human changes remain local in /Users/rick/Github/for-human and should be committed in that repo separately.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant