fix(goal): close human command surface gaps

This commit is contained in:
Tianyi Cui
2026-07-20 12:11:06 +08:00
parent 79d41dfaa9
commit 491dafc785
12 changed files with 47 additions and 28 deletions

View File

@@ -69,7 +69,7 @@ function commandHint(goal: GoalView): string {
case 'usage-limited':
return '/goal edit <objective>, /goal resume, /goal clear'
case 'budget-limited':
return '/goal edit <objective>, /goal clear'
return '/goal edit <objective>, /goal clear; after the agent raises the round cap, /goal resume'
case 'complete':
return '/goal <objective>, /goal clear'
/* v8 ignore next 2 -- the active branch and every non-active phase are handled above */
@@ -149,7 +149,12 @@ function executeGoalCommand(ctx: Context, invocation: CommandInvocation): Comman
default: return assertNever(command, 'goal command')
}
} catch (error: unknown) {
if (error instanceof GoalError) return { kind: 'error', text: error.message }
if (error instanceof GoalError) {
return {
kind: 'error',
text: 'The goal command is not valid for the current state. Run /goal to view available commands.',
}
}
throw error
}
}