DeepSeek Harness auto permission deadlock: projections fix
If you have ever used /permission auto in DeepSeek Harness (DSH) to cut down on approval prompts, you have probably met cannot get required service "sessionProjections" in inactive context. The tool is not broken. Permission presets and auto-review wait for each other during startup: the preset needs the approval entry that auto-review provides, while auto-review waits for the preset to publish its projection. A restart sometimes helps because construction order changes, but as long as a session keeps a durable auto, the deadlock returns.
How to confirm a DeepSeek Harness permission deadlock
Bottom line: you are in the right place when the error contains inactive context, the permission card shows a startup failure or auto-review stays pending, and new sessions still fail to use tools. Run these checks:
- Search the startup log for
cannot restore preset "auto" without its active integrationorpinInitialPermission; expected: a construction-time throw. - Open
/permissionand change a preset; expected: the page opens, but the shield is missing and the change does not apply. - Read the
auto-reviewrow in the plugin list; expected: it stays atpendingrather thanfailed.
According to the reproduction in the discussions, these three appearing together point to the circular dependency between the construction-time scan and autoAdmit (#10233, #9882). For baseline permission settings, see permission approval configuration.
How the DSH circular deadlock forms
Bottom line: permission-presets scans loaded sessions during construction and tries to restore presets, while the auto preset depends on an autoAdmit that auto-review cannot register until permissionPresets is available.
Two source locations line up with the symptom:
permission-presets/src/index.ts:248-250callspinInitialPermissionduring construction, and:428-436throws when no active integration exists.- auto-review's
registerAutodepends on the permissionPresets service, so it never runs before the service publishes.
The throw alone is not the worst part. It happens before the projection is registered, so the permissions projection never appears, every reader of sessionProjections sees inactive context, and all subsequent tool calls fail.
Why a restart sometimes helps
- If auto-review finishes registering before the construction scan runs,
autoAdmitexists and no deadlock occurs. - If a session still carries a durable
auto, a later restore can reproduce the order that deadlocks. - More plugins and more concurrent initialization make the order less stable, which is why the failure looks intermittent.
Three DeepSeek Harness fixes for the preset deadlock
Bottom line: disable auto-review when you need the host now, edit the session header when only a few sessions are affected, and change the construction scan when you can ship a core fix; the three are compatible.
Fix 1: disable auto-review so the host can boot
This is the cheapest and fastest relief when you cannot even reach the settings page. With auto-review off, permission presets fall back to fixed modes and old sessions still open.
- Open
~/.dsh/profiles/<your profile>/cordis.patch.yml; expected: the profile patch file is visible. - Find the
auto-reviewrow and setdisabled: true; if the row is absent, add a same-id disable entry; expected: the row is explicitly disabled. - Quit DSH completely, including the tray process, then start it again; expected: the log no longer shows a
restore preseterror. - Open settings and change every session that still uses
autotodefaultorask; expected: the permission shield returns. - Re-enable auto-review only after step 4; expected: it does not immediately fall back to pending.
Fix 2: remove the durable auto preset from the session header
When only a few sessions trigger it, editing the header preset is more precise than disabling the plugin, but back up first. The durable preset lives in session metadata, not global configuration.
- Quit DSH and back up the entire
~/.dsh/storages/directory; expected: a complete restore point exists. - Under
storages, find the metadata file for the failing session by modification time and search for"preset"or"auto"; expected: the header with a durable auto is located. - Change that session's preset field to
default; do not delete the whole header; expected: the file remains valid session metadata. - Restart and open the session; expected: no
cannot restore preseterror. - If the error persists, another session carries the same field, so repeat step 2; expected: the log stays clean after the last header is fixed.
Fix 3: make the construction scan degrade gracefully
This is the only root fix. Either turn a failed preset restore into a warning plus a deferred repair, or move the scan from construction to first activation. The patch shape discussed is pinInitialPermission(session, { reject }) plus a second sweep.
- In
permission-presets/src/index.ts, change the construction-time scan so a failedpinInitialPermissionlogs a warning and marks the session for repair instead of throwing; expected: one bad session no longer blocks startup. - Add an idempotent sweep after
registerAuto: re-walk marked sessions and attachautoAdmitonce it exists; expected: no session remains marked. - In the
restore presetbranch at:428-436, add a dedicated error code for "integration not ready"; expected: it is not confused with a configuration error. - Regression-test with a session carrying durable auto: boot, restore, switch presets, restart; expected: no pending state.
- Add a unit test where auto-review initializes after permission-presets; expected: the degraded path is proven.
Verify DSH recovery and avoid regressions
Bottom line: at least one new session, one restored session, and two restarts are needed to show the deadlock is gone. Verify:
- Create a session and make a request that triggers a tool call; expected: no
inactive context. - Open an old session; expected: the shield is present and
/permissionchanges apply immediately. - Restart DSH twice; expected: auto-review is not pending on either run.
- If you re-enable auto-review, start with a low-risk tool; expected: the review call completes before you widen scope.
Avoid these traps:
- Do not delete the whole
~/.dshdirectory; that removes session history and plugin configuration, so locate the specific session first. inactive contextcan come from other unloaded fibers; this article covers only the permission-preset plus auto-review case, so use the generic sessionProjections path if it persists with auto-review off.- Fix 3 is core-side and may be overwritten by upgrades; if you are only a DSH plugin user, prefer the first two.
- No official fixed version is listed in the discussions; 0.2.1-rc.2 still reproduces, so check release notes for changes to preset restoration.
DeepSeek Harness permission preset FAQ
Q: Why does DeepSeek Harness report inactive context right after enabling /permission auto? A: DeepSeek Harness reports inactive context because permission-presets and auto-review deadlock during construction, not because session data is corrupt. The preset scan throws on a durable auto, the permissions projection never publishes, and auto-review waits forever; disabling auto-review is the fastest workaround.
Q: Why does DeepSeek Harness fail to restore old sessions after showing 2 entries did not activate? A: DeepSeek Harness shows 2 entries did not activate when the stored session header carries the auto preset while autoAdmit is not registered yet. Disable the auto-review row in the profile so permission-presets can finish construction, then reset the old sessions to default or ask.
Q: Why does auto-review stay pending in DeepSeek Harness while the permissions shield disappears? A: In DeepSeek Harness, a pending auto-review and a missing shield are two views of one failure. The shield disappears because the permissions projection never published; pending means auto-review is waiting for that service, both caused by the construction-time throw.
Q: Must I delete the whole ~/.dsh directory after DeepSeek Harness 0.2.1 breaks new sessions? A: DeepSeek Harness new-session failures do not require deleting the whole ~/.dsh directory. Identify whether the durable auto preset is stored per session or as the global default; edit the session header or the profile permission configuration, and only rename storages for isolation if the session cannot be found.
FAQ
DeepSeek Harness reports inactive context because permission-presets and auto-review deadlock during construction, not because session data is corrupt. The preset scan throws on a durable auto, the permissions projection never publishes, and auto-review waits forever; disabling auto-review is the fastest workaround.
DeepSeek Harness shows 2 entries did not activate when the stored session header carries the auto preset while autoAdmit is not registered yet. Disable the auto-review row in the profile so permission-presets can finish construction, then reset the old sessions to default or ask.
In DeepSeek Harness, a pending auto-review and a missing shield are two views of one failure. The shield disappears because the permissions projection never published; pending means auto-review is waiting for that service, both caused by the construction-time throw.
DeepSeek Harness new-session failures do not require deleting the whole ~/.dsh directory. Identify whether the durable auto preset is stored per session or as the global default; edit the session header or the profile permission configuration, and only rename storages for isolation if the session cannot be found.
Related Terms
- sessionProjections
- sessionProjections is the DeepSeek Harness service that maintains per-session derived views such as permissions and usage. It must be published by an active Cordis fiber; reading it through an unloaded fiber's context throws inactive context.— https://github.com/deepseek-ai/deepseek-harness/discussions/10233
- pinInitialPermission
- pinInitialPermission is the permission-presets function that pins a preset into a session header during initialization so restored sessions keep their permissions. When called during construction with a preset that needs an external integration, it throws instead of degrading.— https://github.com/deepseek-ai/deepseek-harness/discussions/9882
- autoAdmit
- autoAdmit is the automatic approval entry registered by auto-review into the permission system. It exists only after auto-review finishes registering, which is why permission-presets sees undefined during construction.— https://github.com/deepseek-ai/deepseek-harness/discussions/10233
Sources
- #10233 — 0.2.1-rc.2: permission-presets and auto-review circular deadlock permanently drops the permissions projection· deepseek-ai (GitHub Discussions)
- #9882 — A restored session carrying the durable auto preset makes permission-presets throw during construction· deepseek-ai (GitHub Discussions)
- DeepSeek Harness official repository· deepseek-ai (GitHub)