fix(agentic): return structured handoff context on session resume

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-01 20:00:31 +00:00
parent b491f68b91
commit db7b42dc4d
3 changed files with 9 additions and 3 deletions

View file

@ -119,7 +119,10 @@ func TestCommandsSession_CmdSessionResume_Good(t *testing.T) {
assert.True(t, output.Success)
assert.Equal(t, "ses-abc123", output.Session.SessionID)
assert.Equal(t, "active", output.Session.Status)
assert.NotEmpty(t, output.HandoffContext)
assert.Equal(t, "ses-abc123", output.HandoffContext["session_id"])
handoffNotes, ok := output.HandoffContext["handoff_notes"].(map[string]any)
require.True(t, ok)
assert.Equal(t, "Ready for review", handoffNotes["summary"])
assert.Len(t, output.RecentActions, 2)
assert.Len(t, output.Artifacts, 1)
}

View file

@ -610,7 +610,7 @@ func (s *PrepSubsystem) sessionResume(ctx context.Context, _ *mcp.CallToolReques
return nil, SessionResumeOutput{
Success: true,
Session: session,
HandoffContext: session.Handoff,
HandoffContext: sessionHandoffContext(session),
RecentActions: recentSessionActions(session.WorkLog, 20),
Artifacts: session.Artifacts,
}, nil

View file

@ -360,7 +360,10 @@ func TestSession_HandleSessionResume_Good(t *testing.T) {
output, ok := result.Value.(SessionResumeOutput)
require.True(t, ok)
assert.Equal(t, "active", output.Session.Status)
assert.Equal(t, "Ready for review", output.HandoffContext["summary"])
assert.Equal(t, "ses_resume", output.HandoffContext["session_id"])
handoffNotes, ok := output.HandoffContext["handoff_notes"].(map[string]any)
require.True(t, ok)
assert.Equal(t, "Ready for review", handoffNotes["summary"])
require.Len(t, output.RecentActions, 1)
}