You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Only one tool-cordis session can exist per process β second cordis/evolve session fails to mount: Host Cordis inspect provider "Service" is already registered
#2035
Summary
The cordisInspect host registry (CordisInspectRegistryService in packages/extensions/cordis-host-runner) rejects duplicate provider ids. @deepseek-ai/dsh-tool-cordis registers its host inspect providers (Service, Event, Builtin, Tool, β¦) on every mount, and the shipped cordis preset mounts tool-cordis per session. The combination means at most one session composed with tool-cordis can be mounted per process. Every additional session using the cordis preset (or any user preset copied from it) fails to create with:
SessionCreateError: agent-preset-invalid:
preset "cordis" failed to mount:
failed to apply loader entry tool-cordis (@deepseek-ai/dsh-tool-cordis):
Host Cordis inspect provider "Service" is already registered
In the desktop app this cascades badly: the client auto-creates a draft (blank) session per workspace in parallel at startup and retries failed creations in a loop. With several workspaces and a cordis-derived preset as the default, "new session" breaks in every workspace except the one that won the race, with no user-visible explanation (the error is only observable in the console / session.create RPC response).
Environment
DeepSeek Harness Desktop, Windows 11 Home 10.0.26200
@deepseek-ai/dsh 0.1.0-rc.6, @deepseek-ai/dsh-tool-cordis 0.1.0-rc.6, @deepseek-ai/dsh-cordis-host-runner 0.1.0-rc.6
Reproduction
Create a session with the cordis preset (succeeds; its agent stays loaded β a blank draft session is enough).
While that agent is loaded, create a second session with the cordis preset (any workspace).
The second session.create fails with the error above. Same result for any user-authored preset that includes the tool-cordis row.
The window is exactly the lifetime of the first session's agent: once it is unloaded (e.g. idle eviction), the name frees up and the next create succeeds β which makes the failure look intermittent from the UI.
Root cause
tool-cordis apply() runs ctx.effect(() => ctx.cordisInspect.register(provider), β¦) for each of its host inspect providers on every mount (packages/extensions/tool-cordis).
CordisInspectRegistryService.register() throws on a duplicate manifest id (packages/extensions/cordis-host-runner, inspect-registry), and the registry is a process-global host singleton.
The preset plane cannot fix this: wrapping the tool-cordis row in an isolate: { cordisInspect: true } realm starves the plugin instead (nothing inside the realm provides cordisInspect β it is published by the host runner), and moving the row to the host composition would grant the cordis toolset to every session, which the preset's own trust notes advise against.
Suggested fix
Make same-id registrations stack instead of throwing: the newest registration serves list()/query(), and disposing it reactivates the previous one. Provider closures already resolve the requesting agent from the query context, so any live registration answers correctly for any session. Sketch against inspect-registry:
providers = new Map(); // id -> active (top-of-stack) registration
providerStacks = new Map(); // id -> all live registrations, oldest first
register(registration) {
const manifest = validateManifest(registration.manifest);
const stored = { ...registration, manifest };
const stack = this.providerStacks.get(manifest.id) ?? [];
stack.push(stored);
this.providerStacks.set(manifest.id, stack);
this.providers.set(manifest.id, stored);
return () => {
const entries = this.providerStacks.get(manifest.id);
if (entries === undefined) return;
const index = entries.indexOf(stored);
if (index === -1) return;
entries.splice(index, 1);
if (entries.length === 0) {
this.providerStacks.delete(manifest.id);
this.providers.delete(manifest.id);
} else this.providers.set(manifest.id, entries[entries.length - 1]);
};
}
We have been running this as a local patch on the bundled lib/index.js and multiple concurrent cordis/derived-preset sessions now mount and run side by side. An alternative would be keying inspect registrations by owning agent (like the tools registry) β that is a larger change but would also give sessions properly scoped list() output.
One caveat worth deciding deliberately: with stacking, a dynamic package that registers a provider id already taken no longer errors β it shadows the existing provider until stopped. The current "already registered" guard message in startHostHalf would need its wording revisited if this lands.
Secondary UX note
Even with the registry fixed, session.create failures caused by preset mount errors deserve a user-visible surface: today the desktop client silently retries in a loop and the workspace's "new session" button just appears broken.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
The cordisInspect host registry (CordisInspectRegistryService in packages/extensions/cordis-host-runner) rejects duplicate provider ids. @deepseek-ai/dsh-tool-cordis registers its host inspect providers (Service, Event, Builtin, Tool, β¦) on every mount, and the shipped cordis preset mounts tool-cordis per session. The combination means at most one session composed with tool-cordis can be mounted per process. Every additional session using the cordis preset (or any user preset copied from it) fails to create with:
SessionCreateError: agent-preset-invalid:
preset "cordis" failed to mount:
failed to apply loader entry tool-cordis (@deepseek-ai/dsh-tool-cordis):
Host Cordis inspect provider "Service" is already registered
In the desktop app this cascades badly: the client auto-creates a draft (blank) session per workspace in parallel at startup and retries failed creations in a loop. With several workspaces and a cordis-derived preset as the default, "new session" breaks in every workspace except the one that won the race, with no user-visible explanation (the error is only observable in the console / session.create RPC response).
Environment
DeepSeek Harness Desktop, Windows 11 Home 10.0.26200
@deepseek-ai/dsh 0.1.0-rc.6, @deepseek-ai/dsh-tool-cordis 0.1.0-rc.6, @deepseek-ai/dsh-cordis-host-runner 0.1.0-rc.6
Reproduction
Create a session with the cordis preset (succeeds; its agent stays loaded β a blank draft session is enough).
While that agent is loaded, create a second session with the cordis preset (any workspace).
The second session.create fails with the error above. Same result for any user-authored preset that includes the tool-cordis row.
The window is exactly the lifetime of the first session's agent: once it is unloaded (e.g. idle eviction), the name frees up and the next create succeeds β which makes the failure look intermittent from the UI.
Root cause
tool-cordis apply() runs ctx.effect(() => ctx.cordisInspect.register(provider), β¦) for each of its host inspect providers on every mount (packages/extensions/tool-cordis).
CordisInspectRegistryService.register() throws on a duplicate manifest id (packages/extensions/cordis-host-runner, inspect-registry), and the registry is a process-global host singleton.
The preset plane cannot fix this: wrapping the tool-cordis row in an isolate: { cordisInspect: true } realm starves the plugin instead (nothing inside the realm provides cordisInspect β it is published by the host runner), and moving the row to the host composition would grant the cordis toolset to every session, which the preset's own trust notes advise against.
Suggested fix
Make same-id registrations stack instead of throwing: the newest registration serves list()/query(), and disposing it reactivates the previous one. Provider closures already resolve the requesting agent from the query context, so any live registration answers correctly for any session. Sketch against inspect-registry:
providers = new Map(); // id -> active (top-of-stack) registration
providerStacks = new Map(); // id -> all live registrations, oldest first
register(registration) {
const manifest = validateManifest(registration.manifest);
const stored = { ...registration, manifest };
const stack = this.providerStacks.get(manifest.id) ?? [];
stack.push(stored);
this.providerStacks.set(manifest.id, stack);
this.providers.set(manifest.id, stored);
return () => {
const entries = this.providerStacks.get(manifest.id);
if (entries === undefined) return;
const index = entries.indexOf(stored);
if (index === -1) return;
entries.splice(index, 1);
if (entries.length === 0) {
this.providerStacks.delete(manifest.id);
this.providers.delete(manifest.id);
} else this.providers.set(manifest.id, entries[entries.length - 1]);
};
}
We have been running this as a local patch on the bundled lib/index.js and multiple concurrent cordis/derived-preset sessions now mount and run side by side. An alternative would be keying inspect registrations by owning agent (like the tools registry) β that is a larger change but would also give sessions properly scoped list() output.
One caveat worth deciding deliberately: with stacking, a dynamic package that registers a provider id already taken no longer errors β it shadows the existing provider until stopped. The current "already registered" guard message in startHostHalf would need its wording revisited if this lands.
Secondary UX note
Even with the registry fixed, session.create failures caused by preset mount errors deserve a user-visible surface: today the desktop client silently retries in a loop and the workspace's "new session" button just appears broken.
All reactions