mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
Coding sessions need a native way to keep working until a stated completion condition is actually met. This adds a CLI /goal command, goal state and evaluator logic, and a headless-safe command filter so interactive and print-mode runs can both start a goal and continue when the evaluator says more work remains. Constraint: The evaluator must work with saved third-party provider runtimes that may reject structured output schemas. Constraint: Completion evidence must come from visible transcript text, not hidden goal prompts or assistant thinking blocks. Rejected: Implement /goal as a bundled skill only | it would not own the query loop or support native continuation semantics. Rejected: Expose all local-jsx commands to headless mode | interactive UI commands would become available in print mode. Confidence: high Scope-risk: moderate Directive: Keep /goal evaluator evidence scoped to visible transcript text before adding richer completion signals. Tested: bun test src/commands/headless.test.ts src/goals/goalState.test.ts src/goals/goalEvaluator.test.ts Tested: bun run check:server Tested: bun run verify Tested: Real provider /goal smoke with MiniMax-M2.7-highspeed, including a two-turn continuation that logged Goal continuation #1 and completed with GOAL_SMOKE_LOOP_DONE. Not-tested: Durable cross-process goal persistence for resumed sessions.
13 lines
396 B
TypeScript
13 lines
396 B
TypeScript
import type { Command } from '../../commands.js'
|
|
|
|
const goal = {
|
|
type: 'local-jsx',
|
|
supportsNonInteractive: true,
|
|
name: 'goal',
|
|
description: 'Set or manage a completion goal that keeps the session working until it is met',
|
|
argumentHint: '[status|clear|pause|resume|--tokens <budget> <objective>|<objective>]',
|
|
load: () => import('./goal.js'),
|
|
} satisfies Command
|
|
|
|
export default goal
|