fix(agent-kit): provide full thread context to first-time participating roles
When a role participates for the first time (e.g. committer), it previously only received the system prompt + last step output, missing the full thread history. This caused hallucination as the role had to guess what happened. Changes: - build-continuation-prompt.ts: detect first-time roles and include all steps' meta + content for last 2-3 steps (within quota) - context.ts: add isFirstVisit detection helper - types.ts: add isFirstVisit field to AgentContext - hermes.ts: pass isFirstVisit through to prompt builder Fixes #473
This commit is contained in:
@@ -649,6 +649,7 @@ function buildModeratorContext(uwf: UwfStore, chain: ChainState): ModeratorConte
|
||||
detail: step.detail,
|
||||
agent: step.agent,
|
||||
edgePrompt: step.edgePrompt ?? "",
|
||||
content: null, // Moderator doesn't need content
|
||||
}));
|
||||
return { start: chain.start, steps };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user