為什麼 osFoundry 給 Codex 一個工具提議 handoff,另一個工具啟動 run?
這是 Codex CLI 在還沒登入的情況下,第一次呼叫 osFoundry 的 session 工具時拿到的回應: POST /api/v1/external-mcp {"method":"tools/call","params":{"name":"propose_session_handoff","arguments":{}}} HTTP / 2 401 www-authenticate : Bearer resource_metadata="https://api.osfoundry.io/.well-known/oauth-protected-resource/api/v1/external-mcp", error="invalid_token", error_description="Connect osFoundry to continue"…
When the Codex CLI calls osFoundry's session tool for the first time without being logged in, it receives a response indicating that authentication is required. This occurs because the tools/call method with the propose_session_handoff argument is called, and the server responds with a 401 HTTP status code and an error message stating that an authentication token is necessary.
There are two tools that seem to perform the same function: propose_session_handoff and request_session_run. Both require the session_type, session_id, goal, context_summary, and idempotency_key parameters, but they differ in their intended use and the OAuth scopes required to access them. propose_session_handoff is used to send a scoped task and context summary to the owner of an invited session, while request_session_run is used to queue a bounded goal for an agent, team, or loop session where the assistant is an invited runner.
The main difference between the two calls is who initiates the action and when. propose_session_handoff sends a request to the session owner for a handoff, which requires the owner to accept before the run is queued. The handoff status can be pending, accepted, declined, or cancelled. In contrast, request_session_run allows the session owner to grant a runner role, inviting the assistant to a session as a contributor or runner. The owner's approval is still required for the handoff to proceed.
A Python client was reconstructed to validate these limits against the online schema. The client makes three calls (initialize, tools/list, and tools/call) without a token, resulting in a 401 HTTP status code. By comparing the output to the schema, specific limits and requirements for each tool were identified. The propose_session_handoff tool has stricter limits on the goal length (5,000 characters) and requires both a context_summary and requested_output.
On the other hand, request_session_run allows for a longer goal (10,000 characters) and does not require the context_summary or requested_output fields.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.