@code-yeongyu/senpi 2026.10.9 → 2026.10.10

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/bundle/chunks/{app-server-command-2HNDZGTR.js → app-server-command-SZWKEC36.js} +1 -1
  3. package/dist/bundle/chunks/{chunk-MJGHZT4N.js → chunk-3A3C5VVO.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-6EH7QXOG.js → chunk-6VVV27W2.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-CB77NQMN.js → chunk-7GVD54RM.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-CM5QTRC2.js → chunk-H67EVDWG.js} +1 -1
  7. package/dist/bundle/chunks/chunk-IZOTKUWG.js +2 -0
  8. package/dist/bundle/chunks/chunk-N3QEG537.js +14 -0
  9. package/dist/bundle/chunks/{chunk-LUWWM7GA.js → chunk-RADHRQ4K.js} +3 -3
  10. package/dist/bundle/chunks/{chunk-DERNLWDS.js → chunk-WQ77WBQW.js} +26 -26
  11. package/dist/bundle/chunks/{cli-main-VMDAGZCA.js → cli-main-C3AS73Q4.js} +1 -1
  12. package/dist/bundle/chunks/{host-command-HTYYQBSG.js → host-command-X64D7PT3.js} +1 -1
  13. package/dist/bundle/chunks/{host-lifecycle-XZF6IKKO.js → host-lifecycle-GC3GIR2N.js} +1 -1
  14. package/dist/bundle/chunks/{interactive-mode-U7IH4VMJ.js → interactive-mode-KUP43WXL.js} +1 -1
  15. package/dist/bundle/chunks/{multi-session-host-HHIC6N7C.js → multi-session-host-EM24ZBGK.js} +1 -1
  16. package/dist/bundle/chunks/{package-manager-cli-2FXWPM2U.js → package-manager-cli-MGFHGI5O.js} +1 -1
  17. package/dist/bundle/chunks/{rpc-mode-K5YGBGQO.js → rpc-mode-2GT75YBZ.js} +1 -1
  18. package/dist/bundle/chunks/{schedule-command-CVAPK2WQ.js → schedule-command-EQ4PQCRP.js} +1 -1
  19. package/dist/bundle/chunks/{session-control-endpoint-THEF3K7M.js → session-control-endpoint-DOIW7IBF.js} +2 -2
  20. package/dist/bundle/chunks/session-worker.js +37 -37
  21. package/dist/bundle/cli.js +1 -1
  22. package/dist/bundle/index.js +1 -1
  23. package/dist/bundle/rpc-entry.js +1 -1
  24. package/dist/bundle/runtime-manifest.json +1 -1
  25. package/dist/core/agent-session-runtime.d.ts +9 -0
  26. package/dist/core/agent-session-runtime.js +22 -0
  27. package/dist/core/agent-session.d.ts +12 -1
  28. package/dist/core/agent-session.js +36 -4
  29. package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts +5 -0
  30. package/dist/core/extensions/builtin/compaction/context-pipeline.js +1 -0
  31. package/dist/core/extensions/builtin/compaction/index.js +1 -0
  32. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +7 -0
  33. package/dist/core/extensions/builtin/compaction/lane-policy.js +28 -15
  34. package/dist/core/extensions/builtin/rules/rules/finder.js +8 -3
  35. package/dist/core/sdk.js +7 -3
  36. package/dist/core/thinking-levels.d.ts +23 -1
  37. package/dist/core/thinking-levels.js +37 -0
  38. package/dist/main.js +12 -13
  39. package/dist/modes/interactive/interactive-mode.js +8 -0
  40. package/dist/modes/interactive/session-control-endpoint.js +33 -8
  41. package/dist/modes/interactive/session-control-registry.js +3 -1
  42. package/dist/modes/interactive/session-control-wake.d.ts +11 -5
  43. package/dist/modes/interactive/session-control-wake.js +38 -16
  44. package/dist/modes/rpc/connection-handler.d.ts +5 -0
  45. package/dist/modes/rpc/connection-handler.js +29 -2
  46. package/dist/modes/rpc/custom-capability.d.ts +6 -0
  47. package/dist/modes/rpc/custom-capability.js +6 -0
  48. package/dist/modes/rpc/host-daemon-paths.d.ts +5 -4
  49. package/dist/modes/rpc/host-daemon-paths.js +17 -9
  50. package/dist/modes/rpc/host-daemon-registration.d.ts +6 -1
  51. package/dist/modes/rpc/host-daemon-registration.js +6 -2
  52. package/dist/modes/rpc/host-session-control.js +6 -4
  53. package/dist/modes/rpc/rpc-client.d.ts +5 -0
  54. package/dist/modes/rpc/rpc-client.js +7 -0
  55. package/dist/modes/rpc/rpc-mode.js +1 -1
  56. package/dist/modes/rpc/rpc-types.d.ts +9 -0
  57. package/docs/json.md +3 -0
  58. package/docs/rpc.md +35 -0
  59. package/package.json +6 -6
  60. package/dist/bundle/chunks/chunk-M3BQ2PAQ.js +0 -14
  61. package/dist/bundle/chunks/chunk-VJJ53ORU.js +0 -2
@@ -128,7 +128,7 @@ export async function runRpcMode(runtimeHost) {
128
128
  // it from a client handshake; a plain stdio client that sets nothing gets
129
129
  // byte-identical default behavior.
130
130
  const capabilities = parseClientCapabilities(envValue("RPC_CLIENT_CAPABILITIES"));
131
- const handler = createRpcConnectionHandler(runtimeHost, sink, { capabilities });
131
+ const handler = createRpcConnectionHandler(runtimeHost, sink, { capabilities, retryFallbackCommand: true });
132
132
  const signalCleanupHandlers = [];
133
133
  const registerSignalHandlers = () => {
134
134
  const signals = ["SIGTERM"];
@@ -173,6 +173,10 @@ type RpcSessionCommand = {
173
173
  } | {
174
174
  id?: string;
175
175
  type: "abort_retry";
176
+ } | {
177
+ id?: string;
178
+ type: "set_retry_fallback";
179
+ retryFallback: SessionRetryFallbackProfile;
176
180
  } | {
177
181
  id?: string;
178
182
  type: "bash";
@@ -991,6 +995,11 @@ export type RpcResponse = {
991
995
  type: "response";
992
996
  command: "abort_retry";
993
997
  success: true;
998
+ } | {
999
+ id?: string;
1000
+ type: "response";
1001
+ command: "set_retry_fallback";
1002
+ success: true;
994
1003
  } | {
995
1004
  id?: string;
996
1005
  type: "response";
package/docs/json.md CHANGED
@@ -22,6 +22,7 @@ type AgentSessionEvent =
22
22
  | { type: "compaction_end"; reason: "manual" | "threshold" | "overflow"; result: CompactionResult | undefined; aborted: boolean; willRetry: boolean; requestId?: string; accepted?: boolean; rejectionCause?: "cancelled-by-extension" | "external-owner" | "would-overflow" | "circuit-breaker" | "per-turn-cap"; errorMessage?: string }
23
23
  | { type: "session_info_changed"; name: string | undefined }
24
24
  | { type: "thinking_level_changed"; level: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" }
25
+ | { type: "thinking_level_clamped"; provider: string; modelId: string; requestedLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; appliedLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; reason: "model-not-reasoning" | "level-unsupported" }
25
26
  | SystemPromptChangeEvent // type: "system_prompt_change"
26
27
  | ExtensionToolHookLifecycleEvent // type: "tool_hook_status"
27
28
  | { type: "auto_retry_start"; attempt: number; maxAttempts: number; delayMs: number; errorMessage: string }
@@ -55,6 +56,8 @@ type JsonAgentSessionEvent =
55
56
 
56
57
  `queue_update` emits the full pending steering and follow-up queues whenever they change. `compaction_start`, `compaction_progress`, and `compaction_end` cover both manual and automatic compaction. `session_info_changed` fires when the session display name changes, `thinking_level_changed` when the thinking level changes, `system_prompt_change` (see `SystemPromptChangeEvent` in [`extensions/types.ts`](../src/core/extensions/types.ts)) when a model switch changes the active system prompt, and `tool_hook_status` (see `ExtensionToolHookLifecycleEvent` in [`extensions/runner.ts`](../src/core/extensions/runner.ts)) for extension tool hook start/end phases.
57
58
 
59
+ `thinking_level_clamped` fires once per model and requested level when an explicit thinking request (such as `--thinking`, `/thinking`, or a remembered per-model level) runs at a lower level than asked. A level that only comes from the global `defaultThinkingLevel` does not count as a request. In RPC mode, the `thinkingSelection` carried by `thinking_level_changed` and `get_state` then also has `requested` and `clampReason`.
60
+
58
61
  Other base events come from
59
62
  [`AgentEvent`](../../agent/src/types.ts):
60
63
 
package/docs/rpc.md CHANGED
@@ -2191,6 +2191,41 @@ Response:
2191
2191
  {"type": "response", "command": "abort_retry", "success": true}
2192
2192
  ```
2193
2193
 
2194
+ #### set_retry_fallback
2195
+
2196
+ A single-session `--mode rpc` process has no `open_session`. A caller that spawns one process per session (e.g. a task
2197
+ child that runs as its own process) gives it its fallback policy with `set_retry_fallback`:
2198
+
2199
+ ```json
2200
+ {"type": "set_retry_fallback", "retryFallback": {"modelFallback": true, "fallbackChains": {"provider/model": ["provider/spare"]}}}
2201
+ ```
2202
+
2203
+ Response:
2204
+ ```json
2205
+ {"type": "response", "command": "set_retry_fallback", "success": true}
2206
+ ```
2207
+
2208
+ The profile is the same shape, with the same limits, as `open_session.retryFallback`, and it has the same effect. It
2209
+ overrides the session's `retry.modelFallback` and `retry.fallbackChains` in memory only, it is never written to a
2210
+ settings file, and the process's later sessions (`new_session`, `switch_session`, `fork`) keep it.
2211
+
2212
+ It is a launch-time setting:
2213
+ - It is accepted only before the session's first turn. It is refused once this connection has asked for a turn
2214
+ (`prompt`, `steer`, `follow_up`, `continue_from_leaf`, `send_custom_message` with `triggerTurn`), even one that has
2215
+ not started yet, while a turn streams (an extension's included), and once the session holds turn history (a resumed
2216
+ session's). So a chain never changes under a provider request or a retry already in flight. Context messages added
2217
+ before the first turn (role `custom`, from an extension on `session_start` or a `send_custom_message` without
2218
+ `triggerTurn`) are not a turn and do not block it.
2219
+ - Send it on its own and await its response: a `set_retry_fallback` pipelined while a `new_session`, `switch_session`
2220
+ or `fork` is still being created can answer success while the session being created runs without it.
2221
+ - A malformed profile is refused with the `open_session` shape message, and nothing is applied.
2222
+ - A multi-session host refuses the command on its session connections; a host session takes its policy from
2223
+ `open_session.retryFallback`.
2224
+
2225
+ Probe `retry_fallback_command` in `get_protocol_info` before sending it. Only a single-session process advertises it.
2226
+ Unlike an environment variable, the profile reaches this process only, never what its tools spawn. Unlike argv, it has
2227
+ no command-line length limit and is not visible in a process listing.
2228
+
2194
2229
  ### Bash
2195
2230
 
2196
2231
  #### bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi",
3
- "version": "2026.10.9",
3
+ "version": "2026.10.10",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@earendil-works/chord": "0.99.1",
60
- "@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.10.9",
61
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.9",
62
- "@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.10.9",
60
+ "@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.10.10",
61
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.10",
62
+ "@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.10.10",
63
63
  "@silvia-odwyer/photon-node": "0.3.4",
64
64
  "chalk": "6.0.0",
65
65
  "cross-spawn": "7.0.6",
@@ -78,8 +78,8 @@
78
78
  "yaml": "2.9.1",
79
79
  "@anthropic-ai/claude-agent-sdk": "0.3.289",
80
80
  "@anthropic-ai/sdk": "0.127.0",
81
- "@code-yeongyu/senpi-codemode": "2026.10.9",
82
- "@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.10.9",
81
+ "@code-yeongyu/senpi-codemode": "2026.10.10",
82
+ "@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.10.10",
83
83
  "@modelcontextprotocol/sdk": "1.30.0",
84
84
  "@mozilla/readability": "0.6.0",
85
85
  "linkedom": "0.18.13",