MCP session tools: normalize session identifier key across list_sessions and get_session #70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
The MCP session tools surface use two different keys for the session identifier depending on which tool is called.
list_sessionsreturns entries keyedsession_id;get_sessionreturns the same id underid. Every consumer learns the asymmetry the hard way.Source: code review of branch
phase-8/dashboard-ui-pr3-sessionsFile:
crates/cognix-mcp/src/tools/session/list.rs,crates/cognix-mcp/src/tools/session/get.rs,crates/cognix-server/assets/schema.js:16-17Branch:
phase-8/dashboard-ui-pr3-sessionsFailure mode
list_sessionsitems exposesession_id,name,created_at,updated_at,closed_at.get_sessionexposesid,name,created_at,updated_at,closed_at— same record, different identifier key.assets/schema.js:16requiressession_id,schema.js:17requiresid;assets/sessions.js:109readsentry.session_id,sessions.js:154readssession.id, andsessions.js:264sends{ session_id: sessionId }while consuming the response'sid.Why deferred from
phase-8/dashboard-ui-pr3-sessionsProposed work
session_idis the more common spelling and matches the parameter name onget_session/get_thoughtsargumentscrates/cognix-mcp/src/tools/session/get.rsto emit the chosen keycrates/cognix-server/assets/schema.jsvalidators to share a singleREQUIRED_SESSION_KEYSconstantassets/sessions.jscall sites to use the unified keycognix-cli, any scripted agent flows) for hard-codedidaccesses on session payloadsdocs/MCP_TOOLS.mdexamples and the golden parity fixturesAcceptance
list_sessionsandget_sessionagree on the session identifier keyschema.jsreference the sameREQUIRED_SESSION_KEYSconstantdocs/MCP_TOOLS.mdreflects the unified shapeReferences
phase-8/dashboard-ui-pr3-sessionssession_idvsidget_thoughtsJSON envelope)