How does it decide?
After evaluation, the feedback generator validates the result, extracts the score, checks goal completion, and generates feedback. With the default configuration, the coding agent runs evaluation during implementation. With cost-aware selection, Kapso runs it after the finalized candidate passes its cost checks, and the judge reads what that run captured. Every finalized candidate is judged except one refused by the cost check, which carries its refusal as feedback. A build that errored is judged on its session output; a run that failed or overran its deadline is judged on its captured output. Both stay unscored and invalid: only a completed run can validate a score.FeedbackResult
The feedback generator returns aFeedbackResult:
<stop>, <evaluation_valid>, <score>, <feedback>, <cards_load_bearing>. An answer without the tags parses to None; the caller retries once, and a second tagless answer becomes an explicit failure result rather than a silent guess.
What does it check?
1. Validate evaluation
The feedback generator checks if the agent-built evaluation is fair and correct:- Does the evaluation actually test the goal criteria?
- Is the evaluation not trivially passing (e.g.,
print("SCORE: 1.0"))? - Are the metrics appropriate for the problem?
evaluation_valid=False and provides feedback to fix the evaluation.
2. Check goal completion
The feedback generator determines if the goal has been achieved by:- Parsing the evaluation output for success criteria
- Comparing scores against thresholds mentioned in the goal
- Understanding semantic success (e.g., “all tests passed”)
3. Extract score
The feedback generator parses the evaluation output to extract numeric scores:4. Generate feedback
If the goal is not achieved, the feedback generator provides actionable suggestions:How do I use it?
Automatic (via evolve)
The feedback generator is automatically used when you callkapso.evolve():
Direct usage
Configuration
The feedback generator is integrated within the search strategy. You can configure the agent type in the search strategy configuration:How does the search strategy use it?
Feedback generation happens within the search strategy. Each evaluated node gets its own verdict after evaluation, and the orchestrator checksnode.should_stop. The default implementation flow is:
cost: "<number> <unit>". The feedback
flow stores it as node.measured_cost; when cost-aware selection is enabled,
that measurement replaces the estimate in ranking and campaign accounting.
Cost changes selection utility without rewriting node.score. See the
manifest example.
A fixed score threshold would need the evaluation format known in advance and would trust every evaluation equally; the judged verdict reads any format, checks the evaluation itself for fairness, and returns suggestions rather than a bare number.
How do I get useful feedback?
1. Include success criteria in goal
The feedback generator works best when the goal includes clear success criteria:2. Let agent build evaluation
Don’t provideeval_dir unless you have specific evaluation requirements. The agent builds domain-appropriate evaluation:
3. Trust the feedback
The feedback generator provides actionable suggestions. The next iteration’s coding agent receives this feedback and uses it to improve:Related
Execution Flow
Search Strategies
Coding Agents
API Reference
pip install leeroo-kapso · Every page as plain text: llms.txt.