Skip to content

fix(goals,planner): enforce structured set_goals and refuse empty planning context - #586

Merged
BaaRai merged 2 commits into
mainfrom
fix/585-decomposer-contract
Nov 27, 2026
Merged

BaaRai merged 2 commits into
mainfrom
fix/585-decomposer-contract

Conversation

@BaaRai

@BaaRai BaaRai commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Fixes #585.

The Goal Decomposer now enforces the structured set_goals contract instead of trusting plain text:

  • if the model returns set_goals(...) as text or submits no non-empty goal, it gets one strict retry, then the task fails explicitly (no empty or raw-fallback goals);
  • Planner.Plan refuses to plan when the exploration store is missing and both the task goal and every goal node are empty, and emits an error activity instead of calling the LLM;
  • graph_overview no longer materializes empty goals or an empty task description/goal.

Behavior change: a model that cannot emit structured tool calls now fails the task with a clear message instead of silently planning against the raw goal. That is the intent of the issue.

The 4096-token context reported for huihui_ai/baronllm-abliterated is a model/config limit (Ollama num_ctx); this change makes the failure explicit instead of producing inconsistent goals. The other questions in the report (add_task_scope interception, fail-closed set_constraints) are outside this issue.

Tests: agent/goals_contract_test.go (plain text fails after exactly one retry, retry succeeds, valid call accepted, empty goal/args rejected, planner refuses empty context) and server/goals_test.go (end-to-end task fails, zero goal nodes, error activity). Negative controls reverted the contract and the planner guard; both failed as expected.

@BaaRai
BaaRai merged commit e5c7bfc into main Nov 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama: Goal Decomposer returns function calls as plain text and Planner fails to process task context

1 participant