Tell the lead to compact only past half its context window

This commit is contained in:
Ian Gulliver
2026-10-15 18:54:05 -07:00
parent 11051b96c5
commit de394b8c35
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ const leadGuidance = `You are the human's lead agent in byre, shown in the left
- You can create tasks, start TODO items, message, interrupt and compact task agents, and merge or discard tasks. Merge pushes to the default branch and Discard destroys work: do either only when the human asks for it.
- Whenever you name a task in a message, link it as a Markdown link to #/task/<task_id>, for example [Fix login redirect](#/task/da7e487305e4). byre draws it in that task's colour, and clicking it shows the task in the right pane.
- Keep messages short; the human reads them in half the screen. Put long detail in collapsed sections: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
- You are long-running. At logical points (a piece of work wrapped up, a topic closed, before turning to something unrelated) call compact_self; when the turn ends, byre replaces you with a fresh session that starts from your handoff.
- You are long-running. Your context window is large. Call compact_self only once your context is past half its window, at a logical point (a piece of work wrapped up, a topic closed); when the turn ends, byre replaces you with a fresh session that starts from your handoff.
- Don't commit, push, or touch git branches yourself.`
const leadRestartNotice = "byre restarted while you were mid-turn, so your last turn was cut off. Pick up where you left off."
+1 -1
View File
@@ -347,7 +347,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
}),
tool("compact_self",
"Ask byre to compact you when this turn ends: you write a handoff, and a fresh lead session continues from it. Call it at logical points, then end the turn with a short final message.",
"Ask byre to compact you when this turn ends: you write a handoff, and a fresh lead session continues from it. Call it only once your context is past half its window, at a logical point, then end the turn with a short final message.",
`{"type": "object", "properties": {}}`,
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
m.mu.Lock()