Skip to content

feat(desktop): choose a project's model and folder, and see its AGENTS.md (ATO-1012) - #1669

Draft
sosidudku1 wants to merge 4 commits into
rel/xp-buildfrom
feat/ato-1012-project-settings
Draft

sosidudku1 wants to merge 4 commits into
rel/xp-buildfrom
feat/ato-1012-project-settings

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

The Edit project sheet (a project with a folder on disk) now has the rest of a project's settings:

  • Model. A "Model for this project" select listing the cloud models the composer's switcher lists, plus "Same as the app". It reads the switcher's own lists and loaders (selProviders, selLoadGroups / selLoadModels and their caches), so the two never disagree. Saving calls the existing setProjectModel(folder, pick | null). A local model is never offered (one per agent, the note says so), and the row is not drawn for a remote agent or for a project with no disk folder.
  • Folder. "Change folder…" opens the same picker as New project (now one shared projectPickFolder). The new folder is saved with projects:save; the sheet says "New chats open there; chats you already have keep their folder." Chats that were in the project only because they ran in its folder are filed in it by id first, so they don't drop out of it in the sidebar. A folder that already belongs to another project is refused. In main, projects:save copies the project's model in project-models.json from the old folder key to the new one (moveProjectModel); the old key stays for the chats that still run there.
  • AGENTS.md (part of ATO-56). New main/project-instructions-file.ts: instructionsFileFor(folder) returns the first of AGENTS.md, AGENT.md, CLAUDE.md, .claude/CLAUDE.md (the agent's names, same order) with its first 2 KB and the other names it has. A link that leads outside the folder counts as no file (checked with realpath). New IPC projects:instructionsFile takes a project id, so only a stored project's folder is ever read; it returns nothing for a remote agent. The sheet shows "Also follows AGENTS.md in this folder · Open" (Open goes through the reply chips' safe open), and the folder's trust state when the window already knows it.

The new renderer logic is in renderer/project-edit-extras.js, loaded after chat-projects.js. chat-projects.js only gets four typeof hooks in projectEditHTML / projectEditSave and the shared picker. renderer.js is not touched.

Why

A project could only get its own model from the composer, its folder could not be changed once it was set, and nothing in the project told you the agent also follows the folder's AGENTS.md.

Precedent: Claude Projects and ChatGPT Projects keep instructions and files in one project settings sheet; Cursor lists the project rules (AGENTS.md) it follows; LM Studio lets you pick a model per project.

Not in this PR

  • Per-project skills, MCP servers and memory
  • Shared project files (a project file list)
  • A local model per project (one local model per agent, on purpose)
  • Editing AGENTS.md inside the app (Open uses the system editor)

Tests

Added, not run here:

  • desktop/test/project-edit-extras.test.mjs:
    • pure helpers (model value, groups, select, AGENTS.md line)
    • instructionsFileFor with temp folders: the agent's order, the 2 KB head, a link escaping the folder (file and .claude dir), a link inside the folder, folders that aren't usable
    • moveProjectModel
    • the sheet loaded in a vm context: model row, remote and chat-folder cases, Change folder… saving the folder, keeping the chats and saving the model for the new folder, refusing a folder another project already uses
    • source checks for the main, preload and index.html wiring
  • desktop/test/sidebar-nav.test.mjs: the projectsSave call now includes the extra fields.

Verification

Review found two bugs, both fixed in e1559ef:

  • Change folder pinned chats that a nested project owns (project A on /work, project B on /work/app, a chat in /work/app/src) to the moved project A. pexChatsToKeep now finds each chat's owner over all projects (with A still at its old folder) and keeps only A's own.
  • The model pick was moved off the old folder, but a turn's model is read by the chat's own folder and existing chats keep that folder, so they silently fell back to the app's model. moveProjectModel now copies the pick and keeps the old key.

Decided by the product owner (18.11) and done in a follow-up commit: when a project with no model of its own moves to a folder that already has one, that folder's model stays and the sheet shows it (with the line "The new folder already has this model, so the project keeps it.") instead of "Same as the app". Nothing is written for it on Save; a choice made in the sheet still wins.

The MBP run must check: desktop/test/project-edit-extras.test.mjs (updated move test, new nested-project test, new folder-model test); in the app, move a project with an old chat and confirm the old chat keeps the project's model, and that a nested project's chats stay in it.

Not yet checked on the second Mac.

…S.md (ATO-1012)

The Edit project sheet only had a name and instructions, so a project's
own cloud model could be set only from the composer, its folder could not
be changed at all, and nothing said the agent also follows the folder's
AGENTS.md.

- Model: a select with the cloud models the composer's switcher lists
  (its own lists and loaders) plus "Same as the app", saved per folder
  through setProjectModel. Not drawn for a remote agent or a chat folder.
- Folder: Change folder… with the New project picker. Chats that were in
  the project only by their folder are filed in it by id so they stay;
  main moves the folder's model to the new folder (moveProjectModel).
- AGENTS.md: projects:instructionsFile names the first instruction file
  the folder has, in the agent's order, and never reads through a link
  that leaves the folder; Open uses the reply chips' safe open.
…older change (ATO-1012)

Change folder pinned every chat under the old folder to the project,
including chats a nested project owns (the deepest folder wins in the
sidebar). Now the owner is checked over all projects.

The model pick was moved off the old folder, but a turn's model is looked
up by the chat's own folder and existing chats keep the old one, so they
silently fell back to the app's model. The pick is now copied.
… moves there (ATO-1012)

A project with no model of its own moved to a folder that already has
one kept running new chats on that folder's model while the sheet said
Same as the app. The sheet now shows that model and keeps it; a choice
the person made in the sheet is never overwritten.

This branch has not been deployed

No deployments
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