fix(agent): address code review issues

- Add empty goal guard in parser (returns done instead of passthrough)
- Replace `as any` casts in pipeline.ts with proper ActionDecision types
- Add runtime type guards for untrusted LLM output in classifier
- Add intent action to dynamic prompt so UI agent can fire intents

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sanju Sivalingam
2026-02-18 00:32:14 +05:30
parent 3769b21ed1
commit 9193b02d36
4 changed files with 15 additions and 8 deletions

View File

@@ -339,6 +339,7 @@ export function parseGoal(
caps: DeviceCapabilities
): PipelineResult {
const trimmed = goal.trim();
if (!trimmed) return { stage: "parser", type: "done", reason: "Empty goal" };
for (const matcher of PATTERNS) {
const result = matcher(trimmed, caps);
if (result) return result;