Skip to content

Conversation

@celia-oai
Copy link
Contributor

@celia-oai celia-oai commented Nov 14, 2025

this PR does two things:

  1. refactor apply_bespoke_event_handling into a separate file as it's getting kind of long;
  2. add mcp tool call item/started and item/completed events. To roll out app server events asap we didn't properly migrate mcp core events to use TurnItem for mcp tool calls - this will be a follow-up PR.

real events generated in log:

{
  "method": "codex/event/mcp_tool_call_end",
  "params": {
    "conversationId": "019a8021-26af-7c20-83db-21ca81e44d68",
    "id": "0",
    "msg": {
      "call_id": "call_7EjRQkD9HnfyMWf7tGrT9FKA",
      "duration": {
        "nanos": 92708,
        "secs": 0
      },
      "invocation": {
        "arguments": {
          "server": ""
        },
        "server": "codex",
        "tool": "list_mcp_resources"
      },
      "result": {
        "Ok": {
          "content": [
            {
              "text": "{\"resources\":[]}",
              "type": "text"
            }
          ],
          "isError": false
        }
      },
      "type": "mcp_tool_call_end"
    }
  }
}

{
  "method": "item/completed",
  "params": {
    "item": {
      "arguments": {
        "server": ""
      },
      "error": null,
      "id": "call_7EjRQkD9HnfyMWf7tGrT9FKA",
      "result": {
        "content": [
          {
            "text": "{\"resources\":[]}",
            "type": "text"
          }
        ],
        "structuredContent": null
      },
      "server": "codex",
      "status": "completed",
      "tool": "list_mcp_resources",
      "type": "mcpToolCall"
    }
  }
}

@celia-oai celia-oai changed the title tmp [App server] add mcp tool call item started/completed events Nov 14, 2025
@celia-oai celia-oai force-pushed the dev/cc/add-item-3 branch 2 times, most recently from 386ca2f to 361925d Compare November 14, 2025 05:43
@celia-oai celia-oai marked this pull request as ready for review November 14, 2025 05:55
Copy link
Contributor

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! looks straightforward 🙌

use tokio::sync::oneshot;
use tracing::error;

type JsonRpcResult = serde_json::Value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we call this type JsonValue?

@owenlin0 owenlin0 merged commit 526777c into main Nov 14, 2025
25 checks passed
@owenlin0 owenlin0 deleted the dev/cc/add-item-3 branch November 14, 2025 16:08
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants