Skip to content

Keep children's load out of a tree coordinator's system prompt (#895) - #898

Merged
Birfy merged 2 commits into
ThinkFlowLab:mainfrom
Birfy:fix/895-tree-load-line
Oct 23, 2026
Merged

Birfy merged 2 commits into
ThinkFlowLab:mainfrom
Birfy:fix/895-tree-load-line

Conversation

@Birfy

@Birfy Birfy commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #895
Refs #796

A tree coordinator's system prompt carried Child load right now — Dev: working, Test: idle … (#507, #624). plugins/tree/index.js rewrites the tree block at every turn.start / turn.end of a tree Bot, so the coordinator's system prompt changed at every child turn boundary (and every minute for a stalled child). On DeepSeek DSH then appends the whole changed system prompt after the history (systemPromptUpdate: "in-history"); on other routes the cached head misses.

The load line is gone from the prompt (notesFor only: renames, roles and other fixed notes still refresh the block, and writeBlock skips an unchanged block). Coordinator rule 3 now says once, in fixed words: when more than one child fits a part, call list_children before sending it, and prefer an idle or working child to a busy one. Load only ever broke a tie between children whose scope fits, so a part with one fitting child costs no extra call. list_children already returns each child's load, openForMs and stalled live (#507, #624, #733), so the coordinator reads the same facts, fresher, when it routes. loadLine stays a pure helper in load.js (its own tests keep it); the prompt no longer calls it.

Token measurement (plugin test harness, same workload before/after)

Workload main c90af02 this PR
3 children, one turn each (start + end) root system prompt changed 6× 0×
Size of each change (root Chief, 5 children: identity section with the 3,100-char tree block) ≥ ~11,500 chars (~2.9k tokens) appended per change → up to ≈ 69k chars per delegation round at most one list_children call when more than one child fits a part (a few hundred chars)

Verification at 3d4e268057209eda3ba85770b6a01abc095405a3 (rebased on b54f38a)

Not run: smoke bench, Desktop, a real model.

Docs: docs/subsystems/tree.md § Runtime load. Changelog: changelog.d/895-tree-load-line.fixed.md.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 23, 2026
@Birfy Birfy self-assigned this Oct 23, 2026
Birfy added 2 commits October 24, 2026 01:44
…FlowLab#895)

The Child load line changed the coordinator's tree block at every child
turn start and end, so its whole system prompt changed and DSH re-sent all
of it on the next step. list_children already reports load, openForMs and
stalled live; the coordinator rules now point there in fixed words.

Refs ThinkFlowLab#796
…kFlowLab#895)

Load only breaks a tie between children whose scope fits, so a part
with one fitting child costs no extra tool call.

Refs ThinkFlowLab#796
@Birfy
Birfy force-pushed the fix/895-tree-load-line branch from bbc5f0e to 3d4e268 Compare October 23, 2026 17:46
@Birfy

Birfy commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 3d4e268
Written-by: Reviewer

Ran:

  • Fresh worktree detached at 3d4e268057209eda3ba85770b6a01abc095405a3, git status --porcelain empty, then TZ=UTC ARCH_DOCS_BASE=origin/main npm run verify → exit 0: core 1328/1328, plugins 395 + 125 + 125 + 332 + 37 + 16 all pass, arch-docs: OK (6 changed file(s)), ok core/ equals ds-bot/ + patches/ds-bot/
  • Red at base: copied this tip's plugins/tree/test/tree.test.js onto c90af02, node --test --import ./test/resolve.mjs --test-name-pattern="895" test/tree.test.js → fail 1 (the prompt-byte-stable test), passes here
  • git diff origin/main -- plugins/tree read in full; grep -rn loadLine → only load.js, its own tests and docs/subsystems/tree.md

Not run: smoke bench, Desktop, a real-model run.

Findings: no actionable findings.

Security fence / display-name: not in scope (no remote text or fencing touched).

Disclosure: the same executor session that wrote this PR ran this review (owner's instruction to fix these together; Birfy is in selfReview). This is not merge authority by itself; the merge goes through enqueue-guard and the queue.

@github-actions github-actions Bot added the pass label Oct 23, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 23, 2026
Merged via the queue into ThinkFlowLab:main with commit 9f4aa52 Oct 23, 2026
11 checks passed
@Birfy
Birfy deleted the fix/895-tree-load-line branch October 23, 2026 17:53
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tree coordinator's system prompt changes at every child turn boundary (load line), so DSH re-sends it whole

1 participant