Repository navigation
Conversation
5 tasks done
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.
Closes #881
Split out from #899 per review feedback, with all
profile-default-repairandregister.tsreview items addressed:findDanglingDefaultdeletes onlyselectedDefault: ops-ptcat the direct child indentation level underconfig:(and a directly precedingconfig:that becomes childless); it never deletes a- id: agent-preset-registryrow and never touches comments.#comments require preceding whitespace ((?:\s+#.*)?\s*$), so scalars such asselectedDefault: ops-ptc#xare left untouched.\uFEFF) before scanning and repairs every matchingagent-preset-registryrow in the file.repairDanglingDefaultreports three states (status: 'clean' | 'repaired' | 'unrecognized'), warns on'unrecognized'shapes or when<profile.dir>/package.json.lockis present, removes the unuseddryRunparameter, and is wrapped intry/catchinprofileCommandso a filesystem error never turns a completeduninstallinto a non-zero exit.waitForHostIdleinsrc/presets/ops-ptc/register.tswarns and skips the settings write if<profile.dir>/package.json.lockdoes not clear before the deadline.What was wrong
desktop,web,dsh-tui) where@deepseek-ai/dsh-hmris active, disabling or removingdsh-opsruns insidehmr.runExclusive(executinginAsyncLocalStorageistrue). When thedsh-opsfiber disposal calledsettings.update('agent-preset-registry', { selectedDefault }),ConfigEditor.editinvokedhmr.runExclusiveagain, which immediately rejected withError: HMR transactions cannot be nested.PluginManager.removeBundle('dsh-ops'),<profile.dir>/package.json.lockis held across twohmr.runExclusivephases whileConfigEditor.editacquireshmr.runExclusivebeforepackage.json.lock, causing lock contention/timeout if the restore entershmr.runExclusivebefore the outer lock clears.dsh-ops uninstall --profile <desktop|web|tui>delegates todsh plugin remove dsh-opswhile the host is not running, so runtime teardown never executes andselectedDefault: ops-ptcremains in<profile.dir>/cordis.patch.yml, causing every new session to fail withUnknown agent preset: ops-ptc.The change
src/presets/ops-ptc/register.ts:AsyncLocalStoragetransaction (hmr.executing.exit) and wait for bothhmr.operationsand<profile.dir>/package.json.lockto settle before persisting default preset changes inforceDefaultandrestoreDefault; warn and skip the write if the lock does not clear before the deadline.ops-ptcalready saved still restore the operator's prior default or the registry's officialdefault.src/profile-default-repair.ts&src/profile-install.ts:findDanglingDefaultandrepairDanglingDefaultto remove a leftoverselectedDefault: ops-ptcline underconfig:on everyagent-preset-registryentry in<profile.dir>/cordis.patch.yml(never deleting rows or comments), and invokerepairDanglingDefaultafterdsh-ops uninstallsucceeds.test/preset-registration.test.mjs,test/profile-temp.test.mjs&docs/CHANGELOG.md:removeBundleunderpackage.json.lock, lock timeout skip, row/comment preservation, nested keys underconfig:,ops-ptc#x, UTF-8 BOM, multiple registry rows, heldpackage.json.lock, and filesystem error tolerance.Validation
pull_request-triggeredCI requiredrun, URL belownpm run build,npm run typecheck,npm run check:size,node test/run.mjs preset-registration, andnode test/run.mjs profile-temppasssrc/presets/ops-ptc/register.tsandsrc/profile-install.tsturns the new assertions inpreset-registrationandprofile-tempreddocs/CHANGELOG.md## [Unreleased]entry added (English and Chinese)package.jsonversion, oroptionalDependencieschange; no model-facing schema/prompt changeRevert-red verification:
Environment
Linux x64, Node v22.22.1, based on upstream
maincommit88ecc72, local source checkout.