Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

docs(agent): clarify prompt placement fallback and history

thinhlpg70769f03096a
diff --git a/docs/src/pages/docs/agent/project-config.mdx b/docs/src/pages/docs/agent/project-config.mdx
index 12e663eb5..5436bfda5 100644
--- a/docs/src/pages/docs/agent/project-config.mdx
+++ b/docs/src/pages/docs/agent/project-config.mdx
@@ -157,6 +157,8 @@ policy mentions is the tail.
Tail blocks are sent as `<SYSTEM>`-marked guidance after the conversation, including when the
allowlist leaves no stable prompt. They are not system-role messages: provider adapters would
move those ahead of history and defeat the placement policy.
+Once sent successfully, a tail block remains in accepted history at that position rather than
+moving after each tool result. Fresh run context is appended after it; compaction bounds growth.
```toml
[prompt]
@@ -172,6 +174,10 @@ prefix_allow = ["assistant_instructions", "guidelines", "skills", "tool_schemas"
| `prefix_allow` | unset | Contributor ids allowed above the cache line. Unset keeps the placement each contributor declares in code; setting it narrows the prefix to exactly the ids listed. An id that names nothing is an error, not a silent no-op |
| `default` | `"tail"` | Placement for a contributor neither the list nor the code classifies. A contributor that varies within a session stays in the tail whatever this says, and listing one (`date`, `git_state`, `memory_recall`, `plan_addendum`, `todo_addendum`) in `prefix_allow` fails the run instead of costing a cache miss per turn |
+All current contributors either declare their placement or vary, so changing `default` alone has
+no effect today. Use `prefix_allow` to narrow the current prefix. The tool schemas are a request
+field rather than a prompt block and always remain above the cache line, even with an empty list.
+
```bash
jan cli agent status # the resolved placement of every contributor, and why
```
diff --git a/src-tauri/src/core/agent/project.rs b/src-tauri/src/core/agent/project.rs
index aab12a01d..c12b6977c 100644
--- a/src-tauri/src/core/agent/project.rs
+++ b/src-tauri/src/core/agent/project.rs
@@ -43,7 +43,8 @@ pub(crate) struct AgentToml {
pub(crate) struct PromptSection {
/// Placement for a composer no policy mentions, `tail` by default. A
/// composer that varies within a session stays in the tail whatever this
- /// says: the constancy rule outranks it.
+ /// says: the constancy rule outranks it. All current composers already
+ /// declare a placement or vary, so this fallback has no effect today.
#[serde(default)]
pub default: Placement,
/// Composer ids allowed above the cache line (`assistant_instructions`,
@@ -304,8 +305,8 @@ inject = "always"
# project_context, skills, memory_catalog, tool_schemas (the tool array is a
# request field and is always above the cache line).
# prefix_allow = ["assistant_instructions", "guidelines", "skills", "tool_schemas"]
-# Placement for a composer no policy mentions: tail (the default) or prefix.
-# A composer that varies within a session stays in the tail regardless.
+# Fallback for a future unclassified composer: tail (the default) or prefix.
+# No effect on current composers. Use prefix_allow to narrow today's prefix.
# default = "tail"
"#;