feat(06-02): wire session handoff injection into prompt builder and orchestration dispatch

- Add sessionHandoff field to PromptContext interface and Session Handoff section in buildSystemPrompt
- Add getSessionHandoff dependency to orchestration service, load handoff before prompt build
- Update orchestration to prefer task_sessions table over legacy tasks.session_json (SESS-01)
- Wire getSessionHandoff through ServiceGraph into createOrchestrationService

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 4.6 committed 2026-03-26 23:05:16 -04:00
1 parent 5271f7ee5d
commit a1d361b947
3 files changed
+39 -1

No files matched your search

+11
View File
@@ -31,6 +31,8 @@ interface PromptContext {
activeSprint?: SprintRecord | null;
recentDocuments?: DocumentRecord[];
allConnectors?: Array<{ id: string; label: string; status: string }>;
/** D-07: Handoff markdown from a rotated session, injected as context for the agent */
sessionHandoff?: string | null;
}
export function buildSystemPrompt(ctx: PromptContext): string {
@@ -195,6 +197,15 @@ ${relevantProjects.map((p) => `- [${p.id}] ${p.name}: ${p.description || ""} (st
`);
}
// D-07: Inject handoff context from previous rotated session
if (ctx.sessionHandoff) {
sections.push(`# Session Handoff
The following context was preserved from your previous session on this task:
${ctx.sessionHandoff}
`);
}
if (ctx.task) {
sections.push(`# Current Task
- ID: ${ctx.task.id}