DeepSeek Harness tool calls fail in inactive context
A session suddenly reports cannot get required service "sessionProjections" in inactive context, and every tool call in that session fails, regardless of tool or model, while a brand-new session works normally. This is a context lifetime problem in DeepSeek Harness (DSH): the caller holds the ctx of a Cordis fiber that has already unloaded, and the service itself is still published by an active one (source).
Confirm the failure is inactive context in DeepSeek Harness
Treat it as this defect only when the message contains both sessionProjections and inactive context; a 403 points at permissions and a provider name or 400 points at the model.
- Read the error text and confirm the service name and inactive context appear together. Expected: both present and no status code.
- Try an unrelated tool in the same session, such as
bash, a file read, or search. Expected: it fails the same way. - Open a new session and run the same tool. Expected: it works, so the tool is not the variable.
- Restart the host and retry the old session. Expected: it may work briefly, then fail again.
- Check whether a DSH plugin was reloaded or disabled recently. Expected: the time matches the first failure.
| Signal | This fault | Permission fault | Model fault |
|---|---|---|---|
| Error text | mentions inactive context | 403 or preset | provider or 400 |
| New session | works | still fails | still fails |
| Switch tool | always fails | depends on policy | depends on model |
The discussion traced the throw to the get trap in vendor/cordis/src/reflect.ts:136-171: at :163 it checks prop in fiber.inject and throws before the lookup continues upward. The message therefore means the read goes through an unloaded fiber's context, not that the process never had the service (#10272).
Why a DeepSeek Harness session keeps a dead context
The session cached a ctx while its fiber was alive, and nothing replaced the reference when that fiber unloaded.
- A plugin or session obtains
ctxduring initialization and stores it on a long-lived object. Expected: the reference outlives the fiber. - That plugin is hot-reloaded, disabled, or unloaded after an error. Expected: the fiber becomes inactive.
- The session object still holds the old
ctxand nothing invalidates it. Expected: the reference looks usable. - The next tool call reads
sessionProjectionsthrough that stale context. Expected: the get trap runs. - The trap finds the service in the fiber's inject list, but the fiber is inactive, so it throws. Expected: the call fails.
- The session keeps reusing the same context. Expected: every later call fails at the same point.
Hot reloads, frequent plugin restarts, and long-running sessions all raise the odds. Note that "inactive" describes the context, not the service: the service name appears only because it was the read target.
Fix 1: move the work to a new DeepSeek Harness session
This is the fastest recovery when the current conversation is replaceable or its contents can be copied out.
- Copy the last few turns' conclusions, file paths, and open tasks. Expected: a handoff note you can paste.
- Create a new session, paste that context, and run a read-only tool. Expected: the tool returns normally.
- Paste any important tool output as well. Expected: the model continues without re-running expensive tools.
- Archive the old session. Expected: it cannot be reopened by accident.
- Continue the task in the new session. Expected: context is continuous and tools work.
- Watch for ten minutes. Expected: the same error does not return.
- Mark the old session read-only. Expected: no further failed results are appended to it.
The cost is the implicit context left behind. Write conclusions down before moving, and do not expect the model to remember them.
Fix 2: restart DeepSeek Harness so the session rebinds
A restart clears the old fiber and context and recovers some sessions; if the error survives a restart, the bad reference was persisted and you need Fix 1.
- Quit DeepSeek Harness completely. Expected: no DSH process remains.
- Start it again and open the failing session. Expected: the session loads.
- Send a plain text message first, then trigger one tool call. Expected: the tool call completes.
- If tools work, continue; if the same spot fails, switch to Fix 1. Expected: no repeated restarts.
- Note what you did before the failure. Expected: a timeline that shows whether a plugin reload is involved.
- Call two more tools. Expected: no delayed relapse.
- Read the startup log for fiber initialization order. Expected: no plugin failed to load.
A restart rebuilds runtime state once. If you run plugins that reload often, the failure will probably return, and repeating restarts only wastes time.
Fix 3: stop caching ctx at the DeepSeek Harness call site
The durable fix is to keep ctx only for a bounded lifetime, clear it when the fiber disposes, and resolve services through the active context.
- Find the session or plugin field that stores
ctx. Expected: one known cache site with a documented lifetime. - Clear that reference in the fiber's
disposehook, or replace it with a lazy lookup. Expected: the reference disappears at unload. - Read
sessionProjectionsfrom the current active session context. Expected: every read resolves through a live fiber. - Add the fiber id and unload reason to the thrown error. Expected: the next report names the fiber that died.
- Add a test that unloads the fiber and then invokes a tool. Expected: it fails if a stale context is reused.
- Describe the reproduction path in the pull request. Expected: maintainers can compare against 0.2.1-rc.2.
- Grep the codebase for other long-lived
ctxfields. Expected: no second cache site is left behind.
A lazy lookup costs one extra resolution, but it is safer than holding a reference that can expire at any unload. Prefer it on read-heavy paths.
Verify and set bounds after a DeepSeek Harness reload
The repair is complete only when tools survive a plugin reload and a host restart, not just the next call.
- Run three different tools in the repaired session. Expected: none reports
inactive context. - Trigger a plugin reload and call a tool again. Expected: the reference refreshed and the call succeeds.
- Restart the host and reopen the session. Expected: it still works.
- Open a fresh session as a control. Expected: no new missing-service errors.
- Watch the tool failure rate for an hour. Expected: no repeated error at the same point.
- Check that the session log still appends. Expected: tool results are not missing.
- Repeat one tool call five times. Expected: all five succeed with identical output.
When only some tools fail, group them by type before drawing conclusions; two error paths in one session should not be merged into one.
Four limits apply: the service is almost always healthy, a restart does not always rescue the original session, hot reload is the highest-risk operation here, and switching models does not rebuild ctx. No official fixed version appears in the discussion; for the related startup deadlock, see permission auto deadlock.
FAQ
That DeepSeek Harness session holds a context from a Cordis fiber that has already unloaded, and every later tool call reuses it. A new session creates a fresh fiber and context, so it bypasses the problem, while the old session does not heal.
It is a read path problem in DeepSeek Harness. sessionProjections is still published by an active fiber, but the caller holds the ctx of an unloaded one, and the get trap throws before the lookup continues.
DeepSeek Harness reports this fault with both the service name and inactive context in the message. Permission problems show 403 or preset errors, and model problems carry a provider name or a 400.
DeepSeek Harness offers no user-facing repair entry. Export the messages into a new session, or restart the host and reopen so it binds a fresh context; a failure after that means the bad reference was persisted.
Related Terms
- sessionProjections
- sessionProjections is the per-session collection of derived services in DeepSeek Harness, with permissions and usage projections hanging off it. It is published by an active fiber, so reads must use that fiber's context.— https://github.com/deepseek-ai/deepseek-harness/discussions/10272
- inactive context
- inactive context is the context object of an unloaded Cordis fiber. Reading a service through it throws because that fiber's service registration is no longer valid.— https://github.com/deepseek-ai/deepseek-harness/discussions/10272
- fiber
- A fiber is Cordis's plugin runtime unit, registering services and owning lifecycle and dependencies. Once unloaded, its context must not be used by business code.— https://github.com/deepseek-ai/deepseek-harness/discussions/10272
Sources
- #10272 — Cannot get required service sessionProjections in inactive context after running several tasks· deepseek-ai (GitHub Discussions)
- DeepSeek Harness official repository· deepseek-ai (GitHub)