Skip to content

fix(agent): land create_folder (S9) on main - #264

Merged
winlp4ever merged 3 commits into
mainfrom
fix/s9-create-folder-to-main
Aug 29, 2026
Merged

fix(agent): land create_folder (S9) on main#264
winlp4ever merged 3 commits into
mainfrom
fix/s9-create-folder-to-main

Conversation

@winlp4ever

Copy link
Copy Markdown
Contributor

What

Lands S9 (create_folder) on main. S9's PR (#263) was stacked on the S8 branch and, after #262 squash-merged S8 into main, merging #263 folded its commits into the stale S8 branch instead of main — so create_folder, the same-turn folder guards, the session cache, and the folder icons never reached main.

This branch cherry-picks the three S9 commits cleanly onto main:

Why a new PR

#263 is already marked MERGED (into feat/agent-navigate-working-folder), so it can't be re-targeted. A fresh PR from main is the clean way to get the changes onto main.

Verification

  • Cherry-pick applied with no conflicts (S9 builds on the S8 tree already on main).
  • npm run check-all passes.
  • Full S9 test coverage green (create_folder, live-index guards, session cache, folder icon) — 113 tests in the touched suites.

Content is identical to the already-reviewed #263 (which had /code-review high run + findings addressed); this is purely a base-branch recovery.

Let the agent create a nested sub-board and populate it in one turn (create
folder in the working folder -> navigate in -> author -> navigate up), building
on S8's working folder + headless writes.

- BoardMutator.createFolder(label): builds a folder node (type folder, folder
  default size, label + working-folder parentId), auto-placed. StoreMutator
  renders it when the working folder is the visible layer; HeadlessMutator makes
  it off-scene (a subfolder inside a navigated-into folder).
- create_folder(label) tool: returns { folder_id }, enforces the same nesting
  depth cap as the folder tool (MAX_BOARD_DEPTH).
- navigate resolves its target across the working + visible stores, not just the
  pre-turn snapshot, so the agent can enter a folder create_folder just returned.
- Prompt teaches the create-and-populate workflow.

Deferred (per plan 6c, working-folder model is primary): per-call parent_id
overrides on write_note/link_notes.
Code review found several guards reasoned about nodes via the pre-turn
boardNotes snapshot, so folders/notes created earlier in the same turn were
invisible to them.

- Add ctx.liveNodes: an id -> {parentId, type} index the tools update on every
  create. create_folder depth, navigate 'up' parent resolution, and write_note's
  cross-folder guard now consult it, so same-turn nesting is capped, 'up' from a
  just-created folder finds its real parent, and a this-turn id in another layer
  is refused instead of duplicated.
- create_folder also enforces the universal per-level folder count cap (10),
  matching the manual folder tool.
- Cache off-scene sessions per layer on ctx (disposed at turn end) so navigating
  among folders reuses seeded stores instead of re-reading the whole board each
  hop.

Tests: same-turn nesting cap, navigate 'up' to true parent, dup-id refusal,
folder-count cap.
Both tools fell back to the default note icon in the chat's tool-step list.
Map create_folder to the folder-plus icon and navigate to the folder icon
(both Phosphor, via @/components/icons) so the folder-authoring steps read at
a glance.
@winlp4ever
winlp4ever merged commit 3617ed8 into main Aug 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant