Repository navigation
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
Draft
sosidudku1 wants to merge 4 commits into
sosidudku1 wants to merge 4 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Edit project sheet (a project with a folder on disk) now has the rest of a project's settings:
selProviders,selLoadGroups/selLoadModelsand their caches), so the two never disagree. Saving calls the existingsetProjectModel(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.projectPickFolder). The new folder is saved withprojects: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:savecopies the project's model inproject-models.jsonfrom the old folder key to the new one (moveProjectModel); the old key stays for the chats that still run there.main/project-instructions-file.ts:instructionsFileFor(folder)returns the first ofAGENTS.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 IPCprojects:instructionsFiletakes 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 afterchat-projects.js.chat-projects.jsonly gets fourtypeofhooks inprojectEditHTML/projectEditSaveand the shared picker.renderer.jsis 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
Tests
Added, not run here:
desktop/test/project-edit-extras.test.mjs:instructionsFileForwith temp folders: the agent's order, the 2 KB head, a link escaping the folder (file and.claudedir), a link inside the folder, folders that aren't usablemoveProjectModeldesktop/test/sidebar-nav.test.mjs: theprojectsSavecall now includes the extra fields.Verification
Review found two bugs, both fixed in e1559ef:
/work, project B on/work/app, a chat in/work/app/src) to the moved project A.pexChatsToKeepnow finds each chat's owner over all projects (with A still at its old folder) and keeps only A's own.moveProjectModelnow 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.