Repository navigation
fix(server): MCP project create and update save scripts where reads look - #42157
Closed
2SinceJuly wants to merge 1 commit into
Closed
2SinceJuly wants to merge 1 commit into
2SinceJuly wants to merge 1 commit into
Conversation
On installs that folded project settings into Settings, t3_project_create and t3_project_update wrote scripts onto the project record, while every reader (t3_project_read, t3_project_list, the setup-script runner) resolved them from Settings. The agent was told the scripts were saved, then a read returned an empty list. Scripts now go through Settings for both tools. Other overrides for the project are kept. A create whose Settings write fails reports it instead of succeeding silently, as the project itself is already committed. Fixes pingdotgg#42108
2 tasks done
Member
|
Thanks for this. #42128 makes the same change and is the one being kept. #42128 fixes the same scripts persistence problem in the shared project service. That covers the MCP tools and other project callers, whereas this change fixes only the MCP handlers. Your diagnosis and create-then-read regression are useful. We’ll continue with the shared-service fix so script persistence follows the same path for every caller. Closing as a duplicate. |
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.
Problem
t3_project_createandt3_project_updateaccept ascriptsarray and report success, but on installs whose project settings were folded into Settings the scripts are never saved where anything reads them.Reproduced as in #42108 on 0.1.12-nightly.20261124.5178: create a project with one script, then read it back.
t3_project_createreturns"scripts": []t3_project_readright after also returns"scripts": []The setup-script runner reads scripts the same way, so a
runOnWorktreeCreatescript saved this way would never run either.Change
Both tools resolved scripts from Settings through
resolveProjectScripts(packages/shared/src/projectScripts.ts), which returnsprojectSettingsOverrides[id].defaultProjectScriptsfirst and, whenprojectSettingsFoldedis set, never falls back to the project record. The handlers wrote only to the project record, so the two never met.t3_project_createandt3_project_updatenow save scripts throughServerSettings.updateSettingswith a per-projectdefaultProjectScriptsoverride, which is the same place reads and the setup runner resolve them from. Everything else about both tools is unchanged.Scope
Fixes #42108. Bug fix only.
Verification
Added
scripts an agent saves on create are the ones a later read returnsinapps/server/src/mcp/toolkits/project/handlers.test.ts. It folds project settings as a real install does, creates a project through the MCP handler with one script, then reads it back through the same handler.main(fix stashed):t3_project_readreturns"scripts": []while the create response reports the script was saved. Test fails.t3_project_readreturns the same script. Test passes.Full file: 21 passed. The one remaining failure,
a defaulted worktree launch stays shared only when Git says HEAD has no commit, fails identically on unmodifiedmainin this checkout (expected [] to deeply equal [ 'root' ]) and is unrelated.effect-tsgo tsrs --noEmitinapps/serverreports no errors in either changed file.Not checked: I did not drive a live desktop session against a real Claude thread. The reproduction above is at the handler level, which is where the two write and read paths diverge.
Model: Claude Code (this harness) wrote the change and the test; the diagnosis and test design were reviewed by hand.