Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(consolidate): drop the link quota from the bootstrap prompt too

AkitaOnRails0fc426455cca
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e7688ecb..18dc1ec9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,8 +37,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
job-state marker locations, staged-script paths — grounded only in what
the observations show. (#1221)
- Softened the consolidation prompts' wikilink quota that pushed models to
- invent links. The single and batch prompts told the model "2-5 well-chosen
- links per page beat exhaustive linking; zero links should be rare", which
+ invent links. The single, batch and bootstrap prompts told the model "2-5
+ well-chosen links per page beat exhaustive linking; zero links should be
+ rare", which
pressured it to add links just to hit the number. They now state that zero
links is fine when nothing in the input genuinely relates, require a genuine
reason visible in the input for every link, and forbid padding a page with
diff --git a/crates/ai-memory-consolidate/prompts/bootstrap_system.md b/crates/ai-memory-consolidate/prompts/bootstrap_system.md
index 38973657..f3c5d6e8 100644
--- a/crates/ai-memory-consolidate/prompts/bootstrap_system.md
+++ b/crates/ai-memory-consolidate/prompts/bootstrap_system.md
@@ -75,9 +75,13 @@ input — reference it inline with a wikilink:
A missing same-project target is fine: it is recorded as a pending
link and resolves when the page appears. A missing `project:` or
-`_global:` target is reported by lint as broken. 2-5 well-chosen
-links per page beat exhaustive linking; zero links should be rare,
-but never pad with a cross-scope link you cannot see in the input.
+`_global:` target is reported by lint as broken. A few well-chosen
+links beat exhaustive linking, and zero links is fine when nothing
+in the input genuinely relates. Link only where the input gives a
+genuine reason — a page named in the input, one you are emitting
+in this reply, or a same-project page the sources clearly
+relate to. Never pad a page with links to hit a number, and
+never pad with a cross-scope link you cannot see in the input.
## OUTPUT LANGUAGE
diff --git a/crates/ai-memory-consolidate/src/bootstrap.rs b/crates/ai-memory-consolidate/src/bootstrap.rs
index 09ab6204..1b61ae4f 100644
--- a/crates/ai-memory-consolidate/src/bootstrap.rs
+++ b/crates/ai-memory-consolidate/src/bootstrap.rs
@@ -1839,6 +1839,11 @@ mod tests {
assert!(SYSTEM_PROMPT.contains("the supplied sources"));
assert!(SYSTEM_PROMPT.contains("not a repo file path"));
assert!(SYSTEM_PROMPT.contains("never pad with a cross-scope link"));
+ // #1219: no numeric quota pushing the model to invent links.
+ assert!(SYSTEM_PROMPT.contains("zero links is fine"));
+ assert!(SYSTEM_PROMPT.contains("Never pad a page with links to hit a number"));
+ assert!(!SYSTEM_PROMPT.contains("zero links should be rare"));
+ assert!(!SYSTEM_PROMPT.contains("2-5"));
assert!(!SYSTEM_PROMPT.contains("A link whose target does not exist yet is acceptable"));
}