feat: capability handshake contract for Aegis and Claude Code (#885)#899
feat: capability handshake contract for Aegis and Claude Code (#885)#899OneStepAt4time merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
REGRESSION: This PR removes the #842 ordering fix in handleInbound's kill case — channels.sessionEnded is now called BEFORE sessions.killSession instead of after. Fix: preserve #842 ordering: killSession first, then channels.sessionEnded. The approve/reject handler refactor is fine, but the kill case must NOT change the ordering.
|
Addressed the same ordering concern on this branch as well. In inbound kill handling, sessions.killSession() now executes before channels.sessionEnded() to preserve the #842 contract.\n\nValidation run:\n- |
94ffb12 to
67870e5
Compare
There was a problem hiding this comment.
✅ Well-designed capability handshake. Clean negotiation logic, solid test coverage (7 cases), proper input validation. No docs/superpowers leaks. Fixes #885.
Summary
Introduces a formal
protocolVersion + capabilitieshandshake endpoint so Aegis and Claude Code clients can explicitly negotiate feature support before using advanced integration paths. Prevents version-drift breakage and enables safe feature gating.New endpoint
Response (200 when compatible, 409 when not):
{ "protocolVersion": "1", "serverCapabilities": ["session.create", "session.resume", ...], "negotiatedCapabilities": ["session.create", "session.transcript.cursor"], "warnings": [], "compatible": true }Negotiation rules
negotiatedCapabilities= intersection of server and client capabilities (client omits → get full server set)clientVersion < minProtocolVersion→compatible: false,negotiatedCapabilities: []clientVersion > serverVersion→ compatible with forward-compat warningChanges
src/handshake.ts(new):negotiate(),AEGIS_CAPABILITIES,AEGIS_PROTOCOL_VERSION,HandshakeRequest/Responsetypessrc/server.ts:POST /v1/handshakeroutesrc/__tests__/capability-handshake-885.test.ts: 7 testsTests
Closes #885
Aegis version
Developed with: v2.5.3