feat(agents): auto-inject relevant global learnings into planner context (#1830)

* feat(agents): auto-inject relevant global learnings into planner context

* fix(agents): address review feedback for learnings planner injection

- Add features.global_learnings to VALID_CONFIG_KEYS for explicit validation
- Fix error message in cmdConfigSet to mention features.<feature_name> pattern
- Clarify tag syntax in planner injection step (frontmatter tags or objective keywords)
This commit is contained in:
Rezolv
2026-04-05 23:07:57 -04:00
committed by GitHub
parent a70ac27b24
commit d52c880eec
2 changed files with 7 additions and 1 deletions

View File

@@ -1007,6 +1007,10 @@ Read the most recent milestone retrospective and cross-milestone trends. Extract
- **Cost patterns** to inform model selection and agent strategy
</step>
<step name="inject_global_learnings">
If `features.global_learnings` is `true`: run `gsd-tools learnings query --tag <phase_tags> --limit 5`, prefix matches with `[Prior learning from <project>]` as weak priors. Project-local decisions take precedence. Skip silently if disabled or no matches. For tags, use PLAN.md frontmatter `tags` field or keywords from the phase objective, comma-separated (e.g. `--tag auth,database,api`).
</step>
<step name="gather_phase_context">
Use `phase_dir` from init context (already loaded in load_project_state).

View File

@@ -31,6 +31,8 @@ const VALID_CONFIG_KEYS = new Set([
'hooks.context_warnings',
'features.thinking_partner',
'context',
'features.global_learnings',
'learnings.max_inject',
'project_code', 'phase_naming',
'manager.flags.discuss', 'manager.flags.plan', 'manager.flags.execute',
'response_language',
@@ -338,7 +340,7 @@ function cmdConfigSet(cwd, keyPath, value, raw) {
validateKnownConfigKeyPath(keyPath);
if (!isValidConfigKey(keyPath)) {
error(`Unknown config key: "${keyPath}". Valid keys: ${[...VALID_CONFIG_KEYS].sort().join(', ')}, agent_skills.<agent-type>`);
error(`Unknown config key: "${keyPath}". Valid keys: ${[...VALID_CONFIG_KEYS].sort().join(', ')}, agent_skills.<agent-type>, features.<feature_name>`);
}
// Parse value (handle booleans, numbers, and JSON arrays/objects)