dsh-daruma 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -13
- package/lib/config.d.ts +10 -1
- package/lib/config.js +13 -2
- package/lib/config.js.map +1 -1
- package/lib/event-sink.d.ts +16 -0
- package/lib/event-sink.js +13 -0
- package/lib/event-sink.js.map +1 -0
- package/lib/failover-log.js +5 -8
- package/lib/failover-log.js.map +1 -1
- package/lib/host-capabilities.d.ts +8 -0
- package/lib/host-capabilities.js +17 -0
- package/lib/host-capabilities.js.map +1 -0
- package/lib/host-mount.d.ts +38 -0
- package/lib/host-mount.js +38 -0
- package/lib/host-mount.js.map +1 -0
- package/lib/index.js +43 -5
- package/lib/index.js.map +1 -1
- package/lib/mapping.d.ts +57 -3
- package/lib/mapping.js +54 -3
- package/lib/mapping.js.map +1 -1
- package/lib/rpc.js +16 -3
- package/lib/rpc.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -13,9 +13,31 @@ daruma. daruma then:
|
|
|
13
13
|
1. records the failure against the current channel's circuit-breaker state;
|
|
14
14
|
2. when the channel trips (`failureBudget` consecutive failures, or a terminal
|
|
15
15
|
code like `QUOTA` / `INVALID_CREDENTIAL` / `CONTEXT_WINDOW_EXCEEDED`), it
|
|
16
|
-
arms the next routable channel
|
|
16
|
+
arms the next routable channel (the user-chosen backup first, then the
|
|
17
|
+
configured chain) and returns `{ kind: 'retry' }`;
|
|
17
18
|
3. on the retry turn, the `agent/request` waterfall swaps the request config
|
|
18
|
-
onto the armed channel
|
|
19
|
+
onto the armed channel — dropping the caller's `reasoningEffort` when that
|
|
20
|
+
target does not advertise the level (see below);
|
|
21
|
+
4. appends one JSON line per decision to the audit log (see below).
|
|
22
|
+
|
|
23
|
+
**A failover target has to accept the request.** DSH validates an explicit
|
|
24
|
+
`reasoningEffort` against the **target's** own capability and refuses the
|
|
25
|
+
request before any provider I/O; that refusal is raised outside
|
|
26
|
+
`agent/request-error`, so a swapped request carrying an effort the target
|
|
27
|
+
cannot take kills the turn without ever reaching the provider — the failover
|
|
28
|
+
channel never dispatches, and the channel that is actually broken keeps looking
|
|
29
|
+
healthy. daruma therefore reads the target's model metadata on every swap: a
|
|
30
|
+
supported effort is kept, an unsupported (or unresolvable) one is dropped so
|
|
31
|
+
the target can use its own default, and the drop is logged —
|
|
32
|
+
`dsh-daruma: mt::glm-5.3 does not accept reasoning effort "high" …`. Every
|
|
33
|
+
other field (`maxTokens`, temperature, stop sequences) is passed through
|
|
34
|
+
untouched.
|
|
35
|
+
|
|
36
|
+
**Self-healing:** the host exposes no request-success event, so success is
|
|
37
|
+
inferred — an agent whose previous model request never tripped
|
|
38
|
+
`agent/request-error` earns its channel a success record at the next
|
|
39
|
+
`agent/pre-step` or `agent/turn-stopping`. The circuit closes and the failure
|
|
40
|
+
counter resets; tripped channels never linger as zombie `COOLDOWN` entries.
|
|
19
41
|
|
|
20
42
|
Channel health persists to `~/.dsh/daruma/channel-health.json`, so a tripped
|
|
21
43
|
channel stays cooled-down across restarts.
|
|
@@ -25,14 +47,33 @@ channel stays cooled-down across restarts.
|
|
|
25
47
|
When a channel switch happens mid-turn, the web client renders a small
|
|
26
48
|
`daruma` row **inside the conversation flow** (anchored at the failover event,
|
|
27
49
|
right where it occurred): `mt::glm-5.3 failed (RATE_LIMIT) → trying
|
|
28
|
-
|
|
29
|
-
(`failover 2/3 · turn 3 step 1`) on hover.
|
|
50
|
+
mt::deepseek-v4-flash`, with the budget usage
|
|
51
|
+
(`failover 2/3 · turn 3 step 1`) on hover. When recovery is exhausted, a
|
|
52
|
+
red-dotted **give-up row** (`mt::glm-5.3 failed (RATE_LIMIT) → recovery
|
|
53
|
+
budget exhausted, giving up`) renders instead of failing silently.
|
|
30
54
|
|
|
31
55
|
This works through the host's plugin-extensible conversation engine: the
|
|
32
|
-
client registers
|
|
33
|
-
keyed renderer for its node kind, mirroring how
|
|
34
|
-
|
|
35
|
-
the harness, so rows do not survive a page
|
|
56
|
+
client registers definitions claiming `daruma/failover` / `daruma/give-up`
|
|
57
|
+
session events plus a keyed renderer for its node kind, mirroring how
|
|
58
|
+
in-repo retries render. The notices are **live-only** — out-of-repo session
|
|
59
|
+
events are not yet persisted by the harness, so rows do not survive a page
|
|
60
|
+
reload or a resumed session.
|
|
61
|
+
|
|
62
|
+
## Audit log
|
|
63
|
+
|
|
64
|
+
Every failover / give-up / boot decision is appended to
|
|
65
|
+
`~/.dsh/daruma/failover-log.jsonl` (rotates at 2 MiB to one `.1` generation;
|
|
66
|
+
write failures are swallowed — a lost line never breaks recovery):
|
|
67
|
+
|
|
68
|
+
```jsonl
|
|
69
|
+
{"kind":"boot","t":1788860215489,"pid":38660,"channels":["mt::glm-5.3","mt::deepseek-v4-flash","mt-cc::claude-3-5-haiku-latest"],"failureBudget":3,"cooldownMs":30000,"giveUpBudget":8}
|
|
70
|
+
{"kind":"failover","t":1788850743199,"agentId":"session-2c50…","from":"mt::glm-5.3","to":"mt::deepseek-v4-flash","reason":"RATE_LIMIT","turn":1,"step":1,"failoverCount":1,"giveUpBudget":8}
|
|
71
|
+
{"kind":"give-up","t":1788850876140,"agentId":"session-295a…","from":"mt::deepseek-v4-flash","reason":"no-routable-fallback","turn":1,"step":1,"failoverCount":1,"giveUpBudget":8}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`reason` is the failure code for failovers (`RATE_LIMIT`, `QUOTA`, …) or the
|
|
75
|
+
give-up cause (`give-up-budget-exhausted` / `no-routable-fallback`);
|
|
76
|
+
`failoverCount` / `giveUpBudget` capture the budget state at the decision.
|
|
36
77
|
|
|
37
78
|
## Install
|
|
38
79
|
|
|
@@ -53,20 +94,56 @@ bundle defaults) with an ordered failover chain:
|
|
|
53
94
|
config:
|
|
54
95
|
channels:
|
|
55
96
|
- provider: mt
|
|
56
|
-
model:
|
|
97
|
+
model: glm-5.3
|
|
57
98
|
- provider: mt
|
|
58
|
-
model:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
99
|
+
model: deepseek-v4-flash
|
|
100
|
+
- provider: mt-cc
|
|
101
|
+
model: claude-3-5-haiku-latest
|
|
102
|
+
failureBudget: 3 # consecutive failures before a channel trips
|
|
103
|
+
cooldownMs: 30000 # how long a tripped channel stays unroutable
|
|
104
|
+
giveUpBudget: 8 # per-agent failover budget before giving up
|
|
105
|
+
# stateFile: /path/to/isolated/health.json # REQUIRED for test profiles
|
|
106
|
+
# logFile: /path/to/isolated/failover-log.jsonl
|
|
62
107
|
```
|
|
63
108
|
|
|
64
109
|
Each channel is a `{ provider, model }` pair reachable by the LLM adapter
|
|
65
110
|
registry (same names you use in the settings model selector).
|
|
66
111
|
|
|
112
|
+
> ⚠️ Every chain channel must exist in your `settings.yaml` providers — a
|
|
113
|
+
> channel whose provider is missing gets armed on failover, burns one budget
|
|
114
|
+
> slot, and fails again. And test/mock profiles must isolate `stateFile`, or
|
|
115
|
+
> mock channels pollute the production health records.
|
|
116
|
+
|
|
67
117
|
## Development
|
|
68
118
|
|
|
69
119
|
```bash
|
|
70
120
|
pnpm --filter dsh-daruma build
|
|
71
121
|
pnpm --filter dsh-daruma test
|
|
72
122
|
```
|
|
123
|
+
|
|
124
|
+
## Host compatibility boundary
|
|
125
|
+
|
|
126
|
+
The recovery engine is independent of DSH runtime objects. Host-facing session
|
|
127
|
+
writes go through `src/event-sink.ts`; a Session API change or an unavailable
|
|
128
|
+
custom event surface is logged and degraded without interrupting failover.
|
|
129
|
+
`src/host-capabilities.ts` records optional host surfaces (RPC and conversation
|
|
130
|
+
event registry) so client integrations can remain capability-driven as DSH
|
|
131
|
+
releases evolve.
|
|
132
|
+
|
|
133
|
+
The web transport is bound **late, from an injection callback**
|
|
134
|
+
(`src/host-mount.ts`): the host's `dsh-client-connection` provides its
|
|
135
|
+
`connection` service synchronously through `0.1.0-rc.x`, but awaits browser-auth
|
|
136
|
+
setup first on `0.1.5-rc.1`/`0.1.5-rc.2`, so the service may not exist yet when
|
|
137
|
+
this plugin's `apply` runs. Reading it with a synchronous `ctx.get('connection')`
|
|
138
|
+
skipped the `/dsh-daruma` RPC channel — and with it the status dock and backup
|
|
139
|
+
picker — on those hosts, so the mount waits for the service and records the
|
|
140
|
+
capability snapshot at that point. Hosts without a web transport (headless)
|
|
141
|
+
simply never fire the callback.
|
|
142
|
+
|
|
143
|
+
> Known host limitation: on `0.1.5-rc.1`/`0.1.5-rc.2` the channel still cannot
|
|
144
|
+
> register — those hosts dropped `webServer` from the connection plugin's own
|
|
145
|
+
> inject list while `rpc.handle()` registers its route through the service
|
|
146
|
+
> context, so every caller gets `cannot get property "webServer" without
|
|
147
|
+
> inject`. daruma logs that failure loudly and keeps failover working; the
|
|
148
|
+
> panel needs the host fix. See
|
|
149
|
+
> `docs/aegis/evidence/2026-09-11-latest-harness-compat.md`.
|
package/lib/config.d.ts
CHANGED
|
@@ -18,6 +18,15 @@ export interface ResolvedConfig extends RecoveryPolicyConfig {
|
|
|
18
18
|
readonly stateFile: string;
|
|
19
19
|
readonly logFile: string;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the harness home the way the host does (`dsh-home-paths`): an
|
|
23
|
+
* explicit `stateFile` wins, then `$DSH_HOME`, then `~/.dsh`. Honoring
|
|
24
|
+
* `DSH_HOME` keeps test and sandbox profiles isolated on every platform
|
|
25
|
+
* instead of writing into the user's real `~/.dsh`.
|
|
26
|
+
*
|
|
27
|
+
* @param env - environment mapping to read `$DSH_HOME` from.
|
|
28
|
+
* @returns the absolute default state-file path.
|
|
29
|
+
*/
|
|
30
|
+
export declare function defaultStateFile(env?: NodeJS.ProcessEnv): string;
|
|
22
31
|
export declare function defaultLogFile(stateFile: string): string;
|
|
23
32
|
export declare function resolveConfig(raw?: PluginConfig): ResolvedConfig;
|
package/lib/config.js
CHANGED
|
@@ -5,8 +5,19 @@ import { homedir } from 'node:os';
|
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { modelId } from 'daruma-core';
|
|
7
7
|
import { channelIdOf } from "./mapping.js";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the harness home the way the host does (`dsh-home-paths`): an
|
|
10
|
+
* explicit `stateFile` wins, then `$DSH_HOME`, then `~/.dsh`. Honoring
|
|
11
|
+
* `DSH_HOME` keeps test and sandbox profiles isolated on every platform
|
|
12
|
+
* instead of writing into the user's real `~/.dsh`.
|
|
13
|
+
*
|
|
14
|
+
* @param env - environment mapping to read `$DSH_HOME` from.
|
|
15
|
+
* @returns the absolute default state-file path.
|
|
16
|
+
*/
|
|
17
|
+
export function defaultStateFile(env = process.env) {
|
|
18
|
+
const configured = env.DSH_HOME?.trim();
|
|
19
|
+
const home = configured !== undefined && configured !== '' ? configured : join(homedir(), '.dsh');
|
|
20
|
+
return join(home, 'daruma', 'channel-health.json');
|
|
10
21
|
}
|
|
11
22
|
export function defaultLogFile(stateFile) {
|
|
12
23
|
return join(dirname(stateFile), 'failover-log.jsonl');
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAA2C,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAqB1C,MAAM,UAAU,gBAAgB
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAA2C,MAAM,aAAa,CAAA;A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U,GAAG,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAA;IACxE,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,EAAE,cAAc,CAAC,CAAA;IACzE,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACtG,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;IACnE,CAAC;IACD,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAChG,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACjE,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,gBAAgB,EAAE,CAAA;IACrD,OAAO;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,YAAY;QACZ,SAAS;QACT,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC;KAClD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import type { DarumaFailoverEvent, DarumaGiveUpEvent } from './failover-events.ts';
|
|
3
|
+
export type DarumaEvent = {
|
|
4
|
+
type: 'daruma/failover';
|
|
5
|
+
value: DarumaFailoverEvent;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'daruma/give-up';
|
|
8
|
+
value: DarumaGiveUpEvent;
|
|
9
|
+
};
|
|
10
|
+
/** Host boundary for session events. Session failures never break recovery. */
|
|
11
|
+
export interface EventSink {
|
|
12
|
+
append(agent: Agent, event: DarumaEvent): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function createEventSink(logger: {
|
|
15
|
+
warn(message: string): void;
|
|
16
|
+
}): EventSink;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function createEventSink(logger) {
|
|
2
|
+
return {
|
|
3
|
+
append(agent, event) {
|
|
4
|
+
try {
|
|
5
|
+
agent.session.append(event.type, event.value);
|
|
6
|
+
}
|
|
7
|
+
catch (error) {
|
|
8
|
+
logger.warn(`dsh-daruma: session event append unavailable: ${String(error)}`);
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=event-sink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-sink.js","sourceRoot":"","sources":["../src/event-sink.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,eAAe,CAAC,MAAuC;IACrE,OAAO;QACL,MAAM,CAAC,KAAK,EAAE,KAAK;YACjB,IAAI,CAAC;gBACH,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;YAC/C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,iDAAiD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;YAC/E,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/lib/failover-log.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* swallowed; the worst case is a missing or truncated line, never a lost
|
|
12
12
|
* failover.
|
|
13
13
|
*/
|
|
14
|
-
import { appendFileSync, renameSync, statSync } from 'node:fs';
|
|
15
|
-
import {
|
|
14
|
+
import { appendFileSync, mkdirSync, renameSync, statSync } from 'node:fs';
|
|
15
|
+
import { dirname } from 'node:path';
|
|
16
16
|
/** Rotate when the log exceeds this size (kept to one `.1` generation). */
|
|
17
17
|
export const FAILOVER_LOG_ROTATE_BYTES = 2 * 1024 * 1024;
|
|
18
18
|
export class JsonlFailoverLogStore {
|
|
@@ -24,7 +24,7 @@ export class JsonlFailoverLogStore {
|
|
|
24
24
|
append(record) {
|
|
25
25
|
try {
|
|
26
26
|
this.rotateIfNeeded();
|
|
27
|
-
mkdirSync(
|
|
27
|
+
mkdirSync(dirname(this.file), { recursive: true });
|
|
28
28
|
appendFileSync(this.file, `${JSON.stringify(record)}\n`, 'utf8');
|
|
29
29
|
}
|
|
30
30
|
catch {
|
|
@@ -38,12 +38,9 @@ export class JsonlFailoverLogStore {
|
|
|
38
38
|
renameSync(this.file, `${this.file}.1`);
|
|
39
39
|
}
|
|
40
40
|
catch {
|
|
41
|
-
// Missing file, or
|
|
41
|
+
// Missing file, or a platform that refuses the replacement rename:
|
|
42
|
+
// keep appending (no rotation).
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
function dirnameOf(file) {
|
|
46
|
-
const index = Math.max(file.lastIndexOf('/'), file.lastIndexOf('\\'));
|
|
47
|
-
return index <= 0 ? '.' : file.slice(0, index);
|
|
48
|
-
}
|
|
49
46
|
//# sourceMappingURL=failover-log.js.map
|
package/lib/failover-log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failover-log.js","sourceRoot":"","sources":["../src/failover-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"failover-log.js","sourceRoot":"","sources":["../src/failover-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AAmDxD,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE7C,sEAAsE;IACtE,MAAM,CAAC,MAAyB;QAC9B,IAAI,CAAC;YACH,IAAI,CAAC,cAAc,EAAE,CAAA;YACrB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YAClD,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAClE,CAAC;QAAC,MAAM,CAAC;YACP,iDAAiD;QACnD,CAAC;IACH,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC;YACH,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,yBAAyB;gBAAE,OAAM;YAChE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAA;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;YACnE,gCAAgC;QAClC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Runtime feature detection for DSH host API generations. */
|
|
2
|
+
export interface HostCapabilities {
|
|
3
|
+
readonly conversationEvents: boolean;
|
|
4
|
+
readonly rpc: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function detectHostCapabilities(ctx: {
|
|
7
|
+
get(service: string): unknown;
|
|
8
|
+
}): HostCapabilities;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function detectHostCapabilities(ctx) {
|
|
2
|
+
let connection;
|
|
3
|
+
let conversationEvents;
|
|
4
|
+
try {
|
|
5
|
+
connection = ctx.get('connection');
|
|
6
|
+
}
|
|
7
|
+
catch { /* optional */ }
|
|
8
|
+
try {
|
|
9
|
+
conversationEvents = ctx.get('conversationEvents');
|
|
10
|
+
}
|
|
11
|
+
catch { /* optional */ }
|
|
12
|
+
return {
|
|
13
|
+
conversationEvents: conversationEvents !== undefined,
|
|
14
|
+
rpc: connection?.rpc !== undefined,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=host-capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-capabilities.js","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,sBAAsB,CAAC,GAAsC;IAC3E,IAAI,UAAyC,CAAA;IAC7C,IAAI,kBAA2B,CAAA;IAC/B,IAAI,CAAC;QAAC,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,YAAY,CAAkC,CAAA;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IACpG,IAAI,CAAC;QAAC,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IACnF,OAAO;QACL,kBAAkB,EAAE,kBAAkB,KAAK,SAAS;QACpD,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,SAAS;KACnC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Late-bound host surfaces.
|
|
3
|
+
*
|
|
4
|
+
* The web transport (`connection`, owned by the host's `dsh-client-connection`
|
|
5
|
+
* plugin) is not guaranteed to exist when this plugin's `apply` runs. Through
|
|
6
|
+
* `0.1.0-rc.x` the host provides the service synchronously during its own
|
|
7
|
+
* apply; on `0.1.5-rc.1`/`0.1.5-rc.2` it awaits browser-auth setup first and
|
|
8
|
+
* only then provides it. A synchronous `ctx.get('connection')` therefore
|
|
9
|
+
* reports "absent" on the newer hosts, which used to disable the status panel
|
|
10
|
+
* and the backup picker silently.
|
|
11
|
+
*
|
|
12
|
+
* Mounting from an injection callback works for both shapes: it runs as soon as
|
|
13
|
+
* the service appears — including immediately on hosts that provide it eagerly
|
|
14
|
+
* — and never runs where no web transport is composed (headless).
|
|
15
|
+
*
|
|
16
|
+
* Injecting `webServer` as well does NOT help on `0.1.5-rc.1`/`rc.2`: those
|
|
17
|
+
* versions dropped `webServer` from the connection plugin's own inject list
|
|
18
|
+
* while `rpc.handle()` still registers its route through the service context,
|
|
19
|
+
* so every caller gets `cannot get property "webServer" without inject`. That
|
|
20
|
+
* is an upstream regression in the host package, not a caller-side mistake —
|
|
21
|
+
* verified by probe, see `docs/aegis/evidence/2026-09-11-latest-harness-compat.md`.
|
|
22
|
+
*/
|
|
23
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
24
|
+
/** Host service carrying the browser transport. */
|
|
25
|
+
export declare const WEB_TRANSPORT_SERVICE = "connection";
|
|
26
|
+
/** Structural host shape used by {@link mountWithWebTransport}. */
|
|
27
|
+
export interface HostMountHost {
|
|
28
|
+
readonly logger: {
|
|
29
|
+
info(message: string): void;
|
|
30
|
+
};
|
|
31
|
+
inject(services: readonly string[], callback: (injected: Context) => void): unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Run `mount` once the host provides the web transport, and record the host
|
|
35
|
+
* capability snapshot observed at that moment (never from a pre-injection
|
|
36
|
+
* read, which would misreport an eagerly-late host as unsupported).
|
|
37
|
+
*/
|
|
38
|
+
export declare function mountWithWebTransport(ctx: HostMountHost, mount: (transportCtx: Context) => void): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Late-bound host surfaces.
|
|
3
|
+
*
|
|
4
|
+
* The web transport (`connection`, owned by the host's `dsh-client-connection`
|
|
5
|
+
* plugin) is not guaranteed to exist when this plugin's `apply` runs. Through
|
|
6
|
+
* `0.1.0-rc.x` the host provides the service synchronously during its own
|
|
7
|
+
* apply; on `0.1.5-rc.1`/`0.1.5-rc.2` it awaits browser-auth setup first and
|
|
8
|
+
* only then provides it. A synchronous `ctx.get('connection')` therefore
|
|
9
|
+
* reports "absent" on the newer hosts, which used to disable the status panel
|
|
10
|
+
* and the backup picker silently.
|
|
11
|
+
*
|
|
12
|
+
* Mounting from an injection callback works for both shapes: it runs as soon as
|
|
13
|
+
* the service appears — including immediately on hosts that provide it eagerly
|
|
14
|
+
* — and never runs where no web transport is composed (headless).
|
|
15
|
+
*
|
|
16
|
+
* Injecting `webServer` as well does NOT help on `0.1.5-rc.1`/`rc.2`: those
|
|
17
|
+
* versions dropped `webServer` from the connection plugin's own inject list
|
|
18
|
+
* while `rpc.handle()` still registers its route through the service context,
|
|
19
|
+
* so every caller gets `cannot get property "webServer" without inject`. That
|
|
20
|
+
* is an upstream regression in the host package, not a caller-side mistake —
|
|
21
|
+
* verified by probe, see `docs/aegis/evidence/2026-09-11-latest-harness-compat.md`.
|
|
22
|
+
*/
|
|
23
|
+
import { detectHostCapabilities } from "./host-capabilities.js";
|
|
24
|
+
/** Host service carrying the browser transport. */
|
|
25
|
+
export const WEB_TRANSPORT_SERVICE = 'connection';
|
|
26
|
+
/**
|
|
27
|
+
* Run `mount` once the host provides the web transport, and record the host
|
|
28
|
+
* capability snapshot observed at that moment (never from a pre-injection
|
|
29
|
+
* read, which would misreport an eagerly-late host as unsupported).
|
|
30
|
+
*/
|
|
31
|
+
export function mountWithWebTransport(ctx, mount) {
|
|
32
|
+
ctx.inject([WEB_TRANSPORT_SERVICE], (transportCtx) => {
|
|
33
|
+
const capabilities = detectHostCapabilities(transportCtx);
|
|
34
|
+
ctx.logger.info(`dsh-daruma: host capabilities ${JSON.stringify(capabilities)}`);
|
|
35
|
+
mount(transportCtx);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=host-mount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-mount.js","sourceRoot":"","sources":["../src/host-mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,sBAAsB,EAAyB,MAAM,wBAAwB,CAAA;AAEtF,mDAAmD;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAA;AAQjD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,GAAkB,EAClB,KAAsC;IAEtC,GAAG,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE;QACnD,MAAM,YAAY,GAAqB,sBAAsB,CAAC,YAAY,CAAC,CAAA;QAC3E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QAChF,KAAK,CAAC,YAAY,CAAC,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* discovery, backup selection) for the web client UI, and appends a durable
|
|
17
17
|
* `daruma/failover` session event on every channel switch.
|
|
18
18
|
*/
|
|
19
|
-
import { channelIdOf, channelIdOfConfig,
|
|
19
|
+
import { channelIdOf, channelIdOfConfig, toFailoverConfig, toFailureSignal } from "./mapping.js";
|
|
20
20
|
import { resolveConfig } from "./config.js";
|
|
21
21
|
import { RecoveryEngine } from "./engine.js";
|
|
22
22
|
import { JsonFileChannelHealthStore } from "./store.js";
|
|
@@ -25,14 +25,40 @@ import { buildDarumaFailoverEvent, buildDarumaGiveUpEvent } from "./failover-eve
|
|
|
25
25
|
import { mountStatus } from "./status.js";
|
|
26
26
|
import { mountRpc } from "./rpc.js";
|
|
27
27
|
import { modelId } from 'daruma-core';
|
|
28
|
+
import { createEventSink } from "./event-sink.js";
|
|
29
|
+
import { mountWithWebTransport } from "./host-mount.js";
|
|
28
30
|
export const name = 'dsh-daruma';
|
|
29
31
|
export const inject = ['agents', 'settings', 'llm'];
|
|
32
|
+
/**
|
|
33
|
+
* Record what the failover target did with the caller's reasoning effort.
|
|
34
|
+
*
|
|
35
|
+
* A dropped effort is a real change to the request (the target runs at its own
|
|
36
|
+
* default level instead of the user's), so it has to be visible in the server
|
|
37
|
+
* log rather than folded silently into the channel-switch line. `none-requested`
|
|
38
|
+
* and `kept` are the ordinary cases and stay quiet.
|
|
39
|
+
*/
|
|
40
|
+
function logEffortDisposition(ctx, target, effort) {
|
|
41
|
+
switch (effort.kind) {
|
|
42
|
+
case 'none-requested':
|
|
43
|
+
case 'kept':
|
|
44
|
+
return;
|
|
45
|
+
case 'dropped-unsupported':
|
|
46
|
+
ctx.logger.warn(`dsh-daruma: ${target.id} does not accept reasoning effort "${effort.effort}" `
|
|
47
|
+
+ `(advertised: ${effort.accepted.length > 0 ? effort.accepted.join(', ') : 'none'}); `
|
|
48
|
+
+ 'dropping it for the failover request so it can dispatch');
|
|
49
|
+
return;
|
|
50
|
+
case 'dropped-unverifiable':
|
|
51
|
+
ctx.logger.warn(`dsh-daruma: could not resolve reasoning efforts for ${target.id}; `
|
|
52
|
+
+ `dropping "${effort.effort}" so the failover request can dispatch`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
30
55
|
export function apply(ctx, rawConfig = {}) {
|
|
31
56
|
const config = resolveConfig(rawConfig);
|
|
32
57
|
const store = new JsonFileChannelHealthStore(config.stateFile);
|
|
33
58
|
const engine = new RecoveryEngine(config, store);
|
|
34
59
|
const failoverLog = new JsonlFailoverLogStore(config.logFile);
|
|
35
60
|
const status = mountStatus(ctx);
|
|
61
|
+
const eventSink = createEventSink(ctx.logger);
|
|
36
62
|
// Boot record: one line per plugin start, so audits can align restart
|
|
37
63
|
// boundaries with the failover/give-up lines that follow.
|
|
38
64
|
failoverLog.append({
|
|
@@ -66,9 +92,10 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
66
92
|
const armed = pending.get(payload.agent.id);
|
|
67
93
|
if (armed) {
|
|
68
94
|
pending.delete(payload.agent.id);
|
|
69
|
-
const swapped =
|
|
95
|
+
const { config: swapped, effort } = await toFailoverConfig(current, armed, ctx.llm);
|
|
70
96
|
currentChannel.set(payload.agent.id, channelIdOfConfig(swapped));
|
|
71
97
|
ctx.logger.warn(`dsh-daruma: switching ${current.provider}/${current.model} -> ${swapped.provider}/${swapped.model}`);
|
|
98
|
+
logEffortDisposition(ctx, armed, effort);
|
|
72
99
|
return swapped;
|
|
73
100
|
}
|
|
74
101
|
currentChannel.set(payload.agent.id, channelIdOfConfig(current));
|
|
@@ -93,7 +120,7 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
93
120
|
failoverCount: plan.failoverCount,
|
|
94
121
|
giveUpBudget: engine.giveUpBudget,
|
|
95
122
|
});
|
|
96
|
-
payload.agent
|
|
123
|
+
eventSink.append(payload.agent, { type: 'daruma/failover', value: event });
|
|
97
124
|
failoverLog.append({
|
|
98
125
|
kind: 'failover',
|
|
99
126
|
t: event.at,
|
|
@@ -121,7 +148,7 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
121
148
|
failoverCount: plan.failoverCount,
|
|
122
149
|
giveUpBudget: engine.giveUpBudget,
|
|
123
150
|
});
|
|
124
|
-
payload.agent
|
|
151
|
+
eventSink.append(payload.agent, { type: 'daruma/give-up', value: giveUpEvent });
|
|
125
152
|
failoverLog.append({
|
|
126
153
|
kind: 'give-up',
|
|
127
154
|
t: giveUpEvent.at,
|
|
@@ -180,6 +207,17 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
180
207
|
failedSinceRequest.delete(agent.id);
|
|
181
208
|
engine.clearScope(agent.id);
|
|
182
209
|
});
|
|
183
|
-
|
|
210
|
+
// The web transport arrives when the host provides it — on some host
|
|
211
|
+
// generations only after an async setup step — so the RPC channel mounts
|
|
212
|
+
// from an injection callback instead of a synchronous service read.
|
|
213
|
+
mountWithWebTransport(ctx, (transportCtx) => {
|
|
214
|
+
mountRpc(transportCtx, {
|
|
215
|
+
engine,
|
|
216
|
+
currentChannel,
|
|
217
|
+
status,
|
|
218
|
+
getLlm: () => ctx.llm,
|
|
219
|
+
getSettings: () => ctx.settings,
|
|
220
|
+
});
|
|
221
|
+
});
|
|
184
222
|
}
|
|
185
223
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAA0B,MAAM,cAAc,CAAA;AACxH,OAAO,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAoD,MAAM,sBAAsB,CAAA;AACzI,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,OAAO,EAAgC,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAA;AAChC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,CAAU,CAAA;AAW5D;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAAC,GAAY,EAA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,CAAA;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC3E,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,GAAG,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACrC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACxB,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACnC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,qEAAqE;IACrE,yEAAyE;IACzE,oEAAoE;IACpE,qBAAqB,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE;QAC1C,QAAQ,CAAC,YAAY,EAAE;YACrB,MAAM;YACN,cAAc;YACd,MAAM;YACN,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG;YACrB,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ;SAChC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/mapping.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* taxonomy mirrors them. Anything unknown is downgraded to `UNKNOWN`
|
|
6
6
|
* (treated as retryable).
|
|
7
7
|
*/
|
|
8
|
-
import type { LlmCallConfig, LlmFailure } from '@deepseek-ai/dsh-llm';
|
|
8
|
+
import type { LlmCallConfig, LlmFailure, LlmResolvedModelInfo } from '@deepseek-ai/dsh-llm';
|
|
9
9
|
import { type Channel, type ChannelId, type FailureCode, type FailureSignal } from 'daruma-core';
|
|
10
10
|
export declare function toFailureCode(code: string): FailureCode;
|
|
11
11
|
/** Stable channel identity from a provider+model pair. */
|
|
@@ -13,5 +13,59 @@ export declare function channelIdOf(provider: string, model: string): ChannelId;
|
|
|
13
13
|
/** Channel identity of a resolved request config. */
|
|
14
14
|
export declare function channelIdOfConfig(config: LlmCallConfig): ChannelId;
|
|
15
15
|
export declare function toFailureSignal(failure: LlmFailure, channel: ChannelId, occurredAtMs: number): FailureSignal;
|
|
16
|
-
/**
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The one read daruma makes of the LLM runtime before it swaps channels: the
|
|
18
|
+
* target's own model metadata. Structural, so a test can answer it without a
|
|
19
|
+
* runtime.
|
|
20
|
+
*/
|
|
21
|
+
export interface ReasoningCapabilityLookup {
|
|
22
|
+
resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* What became of the caller's reasoning effort when a request moved to a
|
|
26
|
+
* failover target.
|
|
27
|
+
*
|
|
28
|
+
* DSH validates an explicit `reasoningEffort` against the **target's** own
|
|
29
|
+
* capability and refuses the request before any provider I/O
|
|
30
|
+
* (`UNSUPPORTED_REASONING_EFFORT`, raised from `LlmRuntime.prepareCall`). That
|
|
31
|
+
* refusal happens during the loop's request assembly, outside
|
|
32
|
+
* `agent/request-error`, so no plugin gets to recover from it: the turn dies
|
|
33
|
+
* and the failover channel never dispatches. Carrying the caller's level across
|
|
34
|
+
* the swap therefore breaks the failover exactly where it was meant to help,
|
|
35
|
+
* so an effort the target cannot take is dropped instead — the target then
|
|
36
|
+
* applies its own configured default.
|
|
37
|
+
*/
|
|
38
|
+
export type EffortDisposition = {
|
|
39
|
+
readonly kind: 'none-requested';
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'kept';
|
|
42
|
+
readonly effort: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'dropped-unsupported';
|
|
45
|
+
readonly effort: string;
|
|
46
|
+
readonly accepted: readonly string[];
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'dropped-unverifiable';
|
|
49
|
+
readonly effort: string;
|
|
50
|
+
};
|
|
51
|
+
export interface FailoverConfig {
|
|
52
|
+
/** The config to dispatch on the failover target. */
|
|
53
|
+
readonly config: LlmCallConfig;
|
|
54
|
+
/** What happened to the caller's effort, for the server log. */
|
|
55
|
+
readonly effort: EffortDisposition;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Route a request config onto a failover target in a shape that target accepts.
|
|
59
|
+
*
|
|
60
|
+
* Everything except the reasoning effort is copied verbatim: `maxTokens`,
|
|
61
|
+
* temperature and stop sequences are request-header state the caller owns, and
|
|
62
|
+
* a failover must not silently re-shape the task. The effort is the one field
|
|
63
|
+
* the *target* owns, so an unusable one is dropped rather than passed on.
|
|
64
|
+
*
|
|
65
|
+
* @param config - the caller's request config, as it stood on the failed channel.
|
|
66
|
+
* @param target - the channel recovery chose.
|
|
67
|
+
* @param lookup - model-metadata source (`LlmRuntime`); `undefined` when the
|
|
68
|
+
* runtime is unavailable, which fails closed onto "drop the effort".
|
|
69
|
+
* @returns the routed config plus what happened to the effort, for logging.
|
|
70
|
+
*/
|
|
71
|
+
export declare function toFailoverConfig(config: LlmCallConfig, target: Channel, lookup?: ReasoningCapabilityLookup): Promise<FailoverConfig>;
|
package/lib/mapping.js
CHANGED
|
@@ -36,8 +36,59 @@ export function toFailureSignal(failure, channel, occurredAtMs) {
|
|
|
36
36
|
message: failure.message,
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Read the reasoning efforts `target` advertises.
|
|
41
|
+
*
|
|
42
|
+
* An adapter that reports no reasoning metadata (or no adapter at all) is
|
|
43
|
+
* indistinguishable here from a failed lookup — both mean "no effort this
|
|
44
|
+
* target is known to accept".
|
|
45
|
+
*/
|
|
46
|
+
async function readEfforts(lookup, target) {
|
|
47
|
+
if (lookup === undefined)
|
|
48
|
+
return { kind: 'unreadable' };
|
|
49
|
+
try {
|
|
50
|
+
const info = await lookup.resolveModelInfo(target.provider, target.model);
|
|
51
|
+
return { kind: 'read', efforts: (info.reasoning?.efforts ?? []).map((effort) => effort.id) };
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return { kind: 'unreadable' };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Copy a config without its reasoning-effort field (the value is never kept). */
|
|
58
|
+
function withoutEffort(config) {
|
|
59
|
+
const next = { ...config };
|
|
60
|
+
delete next.reasoningEffort;
|
|
61
|
+
return next;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Route a request config onto a failover target in a shape that target accepts.
|
|
65
|
+
*
|
|
66
|
+
* Everything except the reasoning effort is copied verbatim: `maxTokens`,
|
|
67
|
+
* temperature and stop sequences are request-header state the caller owns, and
|
|
68
|
+
* a failover must not silently re-shape the task. The effort is the one field
|
|
69
|
+
* the *target* owns, so an unusable one is dropped rather than passed on.
|
|
70
|
+
*
|
|
71
|
+
* @param config - the caller's request config, as it stood on the failed channel.
|
|
72
|
+
* @param target - the channel recovery chose.
|
|
73
|
+
* @param lookup - model-metadata source (`LlmRuntime`); `undefined` when the
|
|
74
|
+
* runtime is unavailable, which fails closed onto "drop the effort".
|
|
75
|
+
* @returns the routed config plus what happened to the effort, for logging.
|
|
76
|
+
*/
|
|
77
|
+
export async function toFailoverConfig(config, target, lookup) {
|
|
78
|
+
const routed = { ...config, provider: target.provider, model: target.model };
|
|
79
|
+
const requested = config.reasoningEffort;
|
|
80
|
+
if (requested === undefined)
|
|
81
|
+
return { config: routed, effort: { kind: 'none-requested' } };
|
|
82
|
+
const advertised = await readEfforts(lookup, target);
|
|
83
|
+
if (advertised.kind === 'unreadable') {
|
|
84
|
+
return { config: withoutEffort(routed), effort: { kind: 'dropped-unverifiable', effort: requested } };
|
|
85
|
+
}
|
|
86
|
+
if (advertised.efforts.includes(requested)) {
|
|
87
|
+
return { config: routed, effort: { kind: 'kept', effort: requested } };
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
config: withoutEffort(routed),
|
|
91
|
+
effort: { kind: 'dropped-unsupported', effort: requested, accepted: advertised.efforts },
|
|
92
|
+
};
|
|
42
93
|
}
|
|
43
94
|
//# sourceMappingURL=mapping.js.map
|
package/lib/mapping.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,SAAS,GAKV,MAAM,aAAa,CAAA;AAEpB,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC;IACvD,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,OAAO;IACP,yBAAyB;IACzB,oBAAoB;CACrB,CAAC,CAAA;AAEF,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAgB,CAAA;AAC1E,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,KAAa;IACzD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC9D,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,iBAAiB,CAAC,MAAqB;IACrD,OAAO,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAAmB,EACnB,OAAkB,EAClB,YAAoB;IAEpB,OAAO;QACL,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC;QACjC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB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AC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAA;IACvG,CAAC;IACD,IAAI,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAA;IACxE,CAAC;IACD,OAAO;QACL,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,OAAO,EAAE;KACzF,CAAA;AACH,CAAC"}
|
package/lib/rpc.js
CHANGED
|
@@ -65,8 +65,11 @@ async function listCandidates(llm, provider, settings) {
|
|
|
65
65
|
}
|
|
66
66
|
export function mountRpc(ctx, deps) {
|
|
67
67
|
const connection = ctx.get('connection');
|
|
68
|
+
// Callers mount from an injection callback (src/host-mount.ts), so the
|
|
69
|
+
// service is present here; the guard only covers a composition that dropped
|
|
70
|
+
// the transport between injection and mount.
|
|
68
71
|
if (connection === undefined)
|
|
69
|
-
return;
|
|
72
|
+
return;
|
|
70
73
|
const dispatch = async (endpoint, payload, _signal) => {
|
|
71
74
|
try {
|
|
72
75
|
switch (endpoint) {
|
|
@@ -118,7 +121,17 @@ export function mountRpc(ctx, deps) {
|
|
|
118
121
|
};
|
|
119
122
|
}
|
|
120
123
|
};
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
try {
|
|
125
|
+
const dispose = connection.rpc.handle('/dsh-daruma', dispatch, { authority: 'loopback' });
|
|
126
|
+
ctx.effect(() => dispose, 'dsh-daruma: /dsh-daruma rpc channel');
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
// Known host regression: 0.1.5-rc.1/rc.2 dropped `webServer` from the
|
|
130
|
+
// connection plugin's own inject list while `rpc.handle()` still registers
|
|
131
|
+
// its route through the service context, so the call throws for every
|
|
132
|
+
// caller. Fail loudly instead of leaving the panel silently empty.
|
|
133
|
+
ctx.logger.warn(`dsh-daruma: /dsh-daruma rpc channel could not be registered (${messageOf(error)}); `
|
|
134
|
+
+ 'the status dock and backup picker stay disabled on this host generation');
|
|
135
|
+
}
|
|
123
136
|
}
|
|
124
137
|
//# sourceMappingURL=rpc.js.map
|
package/lib/rpc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC7E,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAA;AAClC,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,CAAA;AACtE,CAAC;AAED,kDAAkD;AAClD,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC;WACjD,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAOD,kFAAkF;AAClF,SAAS,cAAc,CAAC,IAAa;IACnC,MAAM,KAAK,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G,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,qCAAqC,CAAC,CAAA;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,sEAAsE;QACtE,2EAA2E;QAC3E,sEAAsE;QACtE,mEAAmE;QACnE,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,gEAAgE,SAAS,CAAC,KAAK,CAAC,KAAK;cACnF,yEAAyE,CAC5E,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-daruma",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Daruma resilience plugin for DeepSeek Harness — detects model-request failures and fails over to another channel to keep long tasks alive.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
66
|
-
"@deepseek-ai/dsh-agent": "
|
|
67
|
-
"@deepseek-ai/dsh-llm": "
|
|
68
|
-
"@deepseek-ai/dsh-session": "
|
|
69
|
-
"@deepseek-ai/dsh-settings": "
|
|
66
|
+
"@deepseek-ai/dsh-agent": ">=0.1.0-rc.7 <0.1.6",
|
|
67
|
+
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.7 <0.1.6",
|
|
68
|
+
"@deepseek-ai/dsh-session": ">=0.1.0-rc.7 <0.1.6",
|
|
69
|
+
"@deepseek-ai/dsh-settings": ">=0.1.0-rc.7 <0.1.6",
|
|
70
70
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|