somora 2026.1026.10 → 2026.1106.3

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 (99) hide show
  1. package/README.md +4 -4
  2. package/config.example.yaml +15 -7
  3. package/docs/a2a.md +1 -1
  4. package/docs/agents.md +15 -8
  5. package/docs/api.md +147 -12
  6. package/docs/builder.md +269 -28
  7. package/docs/compaction.md +39 -4
  8. package/docs/files.md +4 -3
  9. package/docs/memory.md +1 -1
  10. package/docs/mobile.md +115 -10
  11. package/docs/realtime-voice.md +66 -19
  12. package/docs/security.md +3 -2
  13. package/docs/sentinel.md +3 -1
  14. package/docs/setup.md +15 -4
  15. package/docs/skills.md +1 -1
  16. package/docs/tools.md +75 -13
  17. package/docs/videogen.md +2 -2
  18. package/docs/web.md +74 -4
  19. package/package.json +1 -1
  20. package/src/compaction/index.ts +1 -1
  21. package/src/compaction/midturn.ts +35 -2
  22. package/src/compaction/summarize.ts +29 -0
  23. package/src/compaction/types.ts +9 -0
  24. package/src/config/loader.ts +34 -0
  25. package/src/config/reload.ts +1 -0
  26. package/src/config/settings/catalog/agents.ts +324 -0
  27. package/src/config/settings/catalog/automation.ts +104 -0
  28. package/src/config/settings/catalog/engines.ts +156 -0
  29. package/src/config/settings/catalog/general.ts +206 -0
  30. package/src/config/settings/catalog/images.ts +657 -0
  31. package/src/config/settings/catalog/index.ts +129 -0
  32. package/src/config/settings/catalog/interfaces.ts +174 -0
  33. package/src/config/settings/catalog/memory.ts +557 -0
  34. package/src/config/settings/catalog/models.ts +344 -0
  35. package/src/config/settings/catalog/tools-a.ts +298 -0
  36. package/src/config/settings/catalog/tools-b.ts +339 -0
  37. package/src/config/settings/catalog/voice.ts +325 -0
  38. package/src/config/settings/fields.ts +193 -0
  39. package/src/config/settings/refs.ts +76 -0
  40. package/src/config/settings/yaml-edit.ts +530 -0
  41. package/src/config/types.ts +25 -16
  42. package/src/engine/engine-meta-labels.ts +25 -1
  43. package/src/engine/openai-compatible.ts +408 -19
  44. package/src/engine/thinking-params.ts +2 -1
  45. package/src/persona/loader.ts +1 -1
  46. package/src/sentinel/scheduler.ts +27 -10
  47. package/src/server/activity-stream.ts +13 -0
  48. package/src/server/builder-acceptance.ts +190 -0
  49. package/src/server/builder-busy.ts +6 -3
  50. package/src/server/builder-facts.ts +225 -0
  51. package/src/server/builder-prompt.ts +53 -2
  52. package/src/server/builder-session.ts +12 -1
  53. package/src/server/builder-turn-end.ts +134 -0
  54. package/src/server/index.ts +11 -4
  55. package/src/server/prompt-assembly.ts +7 -1
  56. package/src/server/routes/builder.ts +106 -0
  57. package/src/server/routes/chat.ts +16 -1
  58. package/src/server/routes/server.ts +13 -3
  59. package/src/server/routes/settings.ts +406 -0
  60. package/src/server/run-turn-fallback.ts +21 -3
  61. package/src/server/run-turn-types.ts +8 -0
  62. package/src/server/run-turn.ts +38 -12
  63. package/src/server/sse-serializer.ts +3 -1
  64. package/src/server/start-turn.ts +170 -2
  65. package/src/server/work-ledger.ts +1 -0
  66. package/src/testing/own-home.mts +10 -1
  67. package/src/tools/agents/ask-result.ts +8 -0
  68. package/src/tools/agents/ask.ts +9 -0
  69. package/src/tools/agents/builder-dispatch.ts +64 -10
  70. package/src/tools/agents/builder-review.ts +176 -0
  71. package/src/tools/agents/index.ts +2 -0
  72. package/src/tools/builder/short-descriptions.ts +6 -0
  73. package/src/tools/builder/tools.ts +91 -2
  74. package/src/tools/exec/job-store.ts +2 -0
  75. package/src/tools/exec/local.ts +43 -2
  76. package/src/tools/exec/timeout-repeats.ts +138 -0
  77. package/src/tools/exec/tools.ts +27 -1
  78. package/src/tools/file/write-scope.ts +52 -3
  79. package/src/tools/gating.ts +5 -4
  80. package/src/tools/skill/tools.ts +9 -9
  81. package/src/types/events.ts +19 -3
  82. package/src/videogen/generate.ts +47 -0
  83. package/src/videogen/jobs.ts +2 -0
  84. package/src/voice/realtime/call.ts +135 -2
  85. package/src/voice/realtime/manager.ts +6 -0
  86. package/src/voice/realtime/openai-provider.ts +100 -6
  87. package/src/voice/realtime/types.ts +5 -1
  88. package/templates/skills/builder-handover/SKILL.md +22 -0
  89. package/web/dist/assets/index-BVoxGfbc.js +68 -0
  90. package/web/dist/assets/index-BVoxGfbc.js.map +1 -0
  91. package/web/dist/assets/{index-hdBR7ObT.css → index-X7Hrih2o.css} +1 -1
  92. package/web/dist/index.html +2 -2
  93. package/web-mobile/dist/assets/{index-B8UJVJ7V.css → index-DiO_w3fL.css} +1 -1
  94. package/web-mobile/dist/assets/{index-BFmhLylV.js → index-KDmfPamH.js} +11 -11
  95. package/web-mobile/dist/assets/index-KDmfPamH.js.map +1 -0
  96. package/web-mobile/dist/index.html +2 -2
  97. package/web/dist/assets/index-D0hm3iJz.js +0 -68
  98. package/web/dist/assets/index-D0hm3iJz.js.map +0 -1
  99. package/web-mobile/dist/assets/index-BFmhLylV.js.map +0 -1
package/README.md CHANGED
@@ -110,8 +110,8 @@ one you give a repository to.
110
110
  | **Tools** | The whole programme, gated per agent | A short coding set: files, shell, task list, questions, helpers, colleagues, search |
111
111
  | **Turns** | A few rounds; on an OpenAI-compatible model the loop stops at 30 tool calls (the CLI engines run their own loop) | Hours; hundreds of rounds, compaction mid-turn, a task list you watch |
112
112
  | **Memory** | Notices facts, dreams them into notes and the wiki | Reads memory, never writes it; does not dream |
113
- | **Works in** | Its workspace | The pinned project's folder, and only there |
114
- | **Window** | Chat | Chat plus a task panel: mode, plan → Go, tasks, questions, running time |
113
+ | **Works in** | Its workspace | The pinned project's folder, and folders an order allows besides it |
114
+ | **Window** | Chat | Chat plus a task panel, in the web client and on the phone: mode, plan → Go, tasks, acceptance list, questions, running time |
115
115
  | **Made how** | `somora setup agent`, or a folder with an `AGENTS.md` and an `agent.yaml` | A folder whose `agent.yaml` says `kind: builder` — fixed for life |
116
116
 
117
117
  You can talk to a builder directly — describe the project, let it plan,
@@ -134,7 +134,7 @@ On top of chat and memory, each optional and off until configured:
134
134
  prompt, hand back, and the agent continues in the same tab
135
135
  ([docs/browser.md](docs/browser.md)).
136
136
  - **Talking to an agent** — a standing, interruptible voice call in the
137
- web client: a realtime model does the talking, the agent does the
137
+ web client or on the phone: a realtime model does the talking, the agent does the
138
138
  knowing, and a long answer is read out when it lands
139
139
  ([docs/realtime-voice.md](docs/realtime-voice.md)). Separate from
140
140
  dictation and spoken replies ([docs/voice.md](docs/voice.md)).
@@ -373,7 +373,7 @@ Three first-party clients, all hitting the same local server:
373
373
  |---|---|---|
374
374
  | **TUI** | `somora tui` | Terminal multi-agent chat with full keyboard control, the session's queue (`/queue`), memory and tool detail toggles. |
375
375
  | **Web** | `https://<host>.<tailnet>.ts.net:18737/web/` | A browser desktop: one window per agent, drag-and-drop attachments and screenshots, tmux app and shell terminal, Wiki Explorer with link graph, Media gallery, Sessions browser, the agent's Chromium window, server log, an inbox for updates and things that need you, a light or dark theme plus the bundled Ocean theme, or themes of your own (colours and wallpaper, [docs/web.md#themes](docs/web.md#themes)), Abilities matrix (which tools and skills each agent may use), Team and Agent windows, a queue badge per session (what runs, what waits, what is arriving — take back or stop from there), dictation and spoken replies, and a voice window for a live call. HTTPS recommended (needed from other devices and for the microphone); sign in once with the server's key (`somora key link`). [docs/web.md](docs/web.md) |
376
- | **Mobile (PWA)** | `…:18737/mobile/`, then "Add to Home Screen" | The phone app: avatar row to switch agent, a sheet in the header to switch session and model or restore an archived session, the same queue sheet with steering, the thinking level per session, voice input and spoken replies, photo/PDF attachments via the native picker. Signs in once by scanning the QR code from `somora key link`. [docs/mobile.md](docs/mobile.md) |
376
+ | **Mobile (PWA)** | `…:18737/mobile/`, then "Add to Home Screen" | The phone app: avatar row to switch agent, a sheet in the header to switch session and model or restore an archived session, the same queue sheet with steering, the thinking level per session, a tools switch that shows a turn's tool calls, a builder's panel (mode, phase, Go, task and acceptance lists), voice input and spoken replies, a live voice call with an agent, photo/PDF attachments via the native picker. Signs in once by scanning the QR code from `somora key link`. [docs/mobile.md](docs/mobile.md) |
377
377
 
378
378
  Anything else can talk to the server the same way the clients do, with
379
379
  the server's key in an `Authorization: Bearer` header:
@@ -520,6 +520,9 @@ providers:
520
520
  # compaction:
521
521
  # triggerRatio: 0.8 # compact at 80% of the input budget (window minus the answer)
522
522
  # safetyCushionPairs: 4 # keep N most-recent user/assistant pairs uncompacted
523
+ # builderTargetRatio: 0.6 # builders only: a turn starts with at most 60% of the input
524
+ # # budget used; the compaction keeps only the newest exchanges
525
+ # # that fit below it (0.2 to 0.9)
523
526
  # modelOverride: opus # force a specific worker model (alias or provider/id)
524
527
  # workers: [small-local, big-local, opus] # who may summarise, in the order they are tried.
525
528
  # # A model that is not listed is never a worker. Without the list
@@ -540,13 +543,15 @@ providers:
540
543
  # # google has no adapter yet (different protocol entirely).
541
544
  # model: gpt-realtime-2.1-mini
542
545
  # apiKeyFile: ~/.somora/secrets/openai-realtime.key # a FILE (chmod 600), never the key itself
543
- # # url: ws://127.0.0.1:8787/realtime # where to connect. Omitted = OpenAI. Required for
546
+ # # url: ws://<host>:8766/v1/realtime # where to connect. Omitted = OpenAI. Required for
544
547
  # # provider: local. The model id is appended as ?model=…, and a
545
548
  # # service without a credential needs no apiKeyFile.
546
- # transport: websocket # audio goes browser -> somora -> provider
547
549
  # defaultVoice: alloy # alloy ash ballad coral echo sage shimmer verse marin cedar
550
+ # # provider: local -> defaultVoice: <set-name>, a set on the service
548
551
  # consultPolicy: always # auto | substantive | always — when the voice must ask the agent
549
552
  # maxCallMinutes: 20 # hard stop; the meter runs while nobody speaks
553
+ # keepTranscript: true # one folded call record per call in the session; the agent's
554
+ # # context, memory and dreams never read it
550
555
  # allowAgentSwitch: false # let a call move to another agent or session mid-conversation
551
556
  # consult: # how long a spoken question waits on the agent. It queues on
552
557
  # # the session like any turn, but a conversation cannot wait on
@@ -571,7 +576,7 @@ providers:
571
576
  # back to the parent as a follow-up (an echo). docs/agents.md.
572
577
  # subagents:
573
578
  # tools:
574
- # deny: [agent_ask, agent_ask_result, agent_ask_cancel]
579
+ # deny: [agent_ask, agent_ask_result, agent_ask_cancel, builder_review]
575
580
 
576
581
  # Agent-loop tunables. Apply to engines that run
577
582
  # their own tool-call loop — currently openai-compatible — for the per-
@@ -598,9 +603,9 @@ providers:
598
603
  #
599
604
  # maxTurnMs: 28800000 # optional wall-clock cap per turn (ms).
600
605
  # # Unset = none. Builder agents (agent.yaml
601
- # # kind: builder) default to 500 rounds,
602
- # # 2000 tool calls and 8 h per turn and
603
- # # may override all three per agent
606
+ # # kind: builder) default to no round
607
+ # # cap, 2000 tool calls and 8 h per turn
608
+ # # and may override all three per agent
604
609
  # # (agent.yaml agentLoop, docs/builder.md).
605
610
  #
606
611
  # toolCallTimeoutMs: 30000 # 30 sec — fast tools (memory_search,
@@ -800,6 +805,9 @@ providers:
800
805
  # # 384 dim, ~30MB), all-mpnet-base-v2 (768 dim,
801
806
  # # ~110MB), paraphrase-multilingual-MiniLM-L12-v2
802
807
  # # (multilingual, 384 dim, ~120MB)
808
+ # # choose it BEFORE memory is first indexed: a
809
+ # # change later mixes old and new vectors, and a
810
+ # # different vector size stops memory from starting
803
811
  # chunking:
804
812
  # targetTokens: 400
805
813
  # overlapTokens: 80
@@ -984,7 +992,7 @@ providers:
984
992
  # maxMessageChars: 64000 # longest task text
985
993
  # archiveAfterDays: 7 # quiet conversations with peers are archived
986
994
  # tools:
987
- # deny: [agent_ask, agent_ask_result, agent_ask_cancel, spawn_subagent, spawn_subagents, builder_dispatch, session_model, sentinel]
995
+ # deny: [agent_ask, agent_ask_result, agent_ask_cancel, spawn_subagent, spawn_subagents, builder_dispatch, builder_review, session_model, sentinel]
988
996
 
989
997
  # Web-tools credentials. Per-provider keys — tools whose provider isn't
990
998
  # configured are hidden from the agent (the `available()` probe on the
package/docs/a2a.md CHANGED
@@ -407,7 +407,7 @@ curl https://<host>.<tailnet>.ts.net:18737/a2a/agents/<agent>/.well-known/agent-
407
407
  | `a2a.replyTimeoutSeconds` | `300` | How long a waiting request waits for the answer before it returns the task as still working. |
408
408
  | `a2a.maxMessageChars` | `64000` | Longest task text. |
409
409
  | `a2a.archiveAfterDays` | `7` | A conversation with a peer is archived after this many days without activity. `0` keeps them. |
410
- | `a2a.tools.deny` | `agent_ask`, `agent_ask_result`, `agent_ask_cancel`, `spawn_subagent`, `spawn_subagents`, `builder_dispatch`, `session_model`, `sentinel` | Tools a task from outside may not use, as in `subagents.tools.deny`. |
410
+ | `a2a.tools.deny` | `agent_ask`, `agent_ask_result`, `agent_ask_cancel`, `spawn_subagent`, `spawn_subagents`, `builder_dispatch`, `builder_review`, `session_model`, `sentinel` | Tools a task from outside may not use, as in `subagents.tools.deny`. |
411
411
 
412
412
  The address of an agent is `<publicUrl>/a2a/agents/<agent>`. somora
413
413
  needs no extra port: the A2A endpoint is part of its server, reachable
package/docs/agents.md CHANGED
@@ -72,9 +72,9 @@ and is set up in `config.yaml`, not in an agent folder.
72
72
  | **Its prompt** | Its persona files, your team, the wiki map, memory recall | Harness rules, an environment block, the repository's own `AGENTS.md` or `CLAUDE.md`. No persona prose, no memory recall |
73
73
  | **Tools** | Everything configured, minus what you hide | A short coding set, plus what you allow |
74
74
  | **Skills** | All, minus what you hide | None, plus what you allow |
75
- | **Turn limits** | The server's `agentLoop` values: 8 rounds, 30 tool calls | 500 rounds, 2000 tool calls, 8 hours |
76
- | **Memory** | Notices facts, dreams them into notes and the wiki | Reads memory, never writes it, does not dream |
77
- | **Works in** | Its workspace | The pinned project's folder |
75
+ | **Turn limits** | The server's `agentLoop` values: 8 rounds, 30 tool calls | No round cap, 2000 tool calls, 8 hours |
76
+ | **Memory** | Notices facts, dreams them into notes and the wiki | Reads memory, never writes it, does not dream unless `dreams: true` |
77
+ | **Works in** | Its workspace | The pinned project's folder, and folders an order allows |
78
78
  | **Window** | Chat | Chat plus a task panel |
79
79
 
80
80
  ## The agent folder
@@ -439,14 +439,14 @@ The sub keeps running and the parent is woken when it finishes.
439
439
 
440
440
  A session started as a sub-agent never gets the tools listed under
441
441
  `subagents.tools.deny` in `config.yaml`, whatever persona and model it
442
- runs with. By default these are `agent_ask`, `agent_ask_result` and
443
- `agent_ask_cancel`. A sub's final answer reaches its parent on its own,
442
+ runs with. By default these are `agent_ask`, `agent_ask_result`,
443
+ `agent_ask_cancel` and `builder_review`. A sub's final answer reaches its parent on its own,
444
444
  so it has nothing to send that way.
445
445
 
446
446
  ```yaml
447
447
  subagents:
448
448
  tools:
449
- deny: [agent_ask, agent_ask_result, agent_ask_cancel] # the default
449
+ deny: [agent_ask, agent_ask_result, agent_ask_cancel, builder_review] # the default
450
450
  ```
451
451
 
452
452
  - The entries take the same forms as `tools.deny` in `agent.yaml`: a
@@ -703,6 +703,13 @@ How the fallback chain works:
703
703
  - **Refusals as text.** Some providers send their refusal, such as a
704
704
  quota notice, as answer text and then report an error. That text is
705
705
  not an answer, so the chain still runs.
706
+ - **A conversation too big is not a failure.** When it does not fit
707
+ the model's window even after compacting twice, the chain skips
708
+ every backup whose window is no larger. A smaller model cannot hold
709
+ what a bigger one could not.
710
+ - **The asking agent sees it.** An agent that asked this one gets the
711
+ model that answered (`model`) and, after a switch, `fallback` with
712
+ the model it asked for and why. Its wake-up says so too.
706
713
  - **You see it.** The turn carries a fallback chip and the web client
707
714
  shows a notice.
708
715
  - **Dead models are remembered.** A model that was unreachable is
@@ -722,7 +729,7 @@ How the fallback chain works:
722
729
  | `a2a` | boolean | `false` | Other agent systems may send this agent tasks over [A2A](a2a.md#taking-work-in), if `config.yaml` lists them under `a2a.peers`. Also the A2A switch in the Agent window. Never for a builder. |
723
730
  | `steering` | boolean | `false` | Default for a message typed in the web client while a turn runs. `true` hands it into the running turn before its next step. `false` queues it as its own turn. The toggle next to Send flips it per message. Steering works on every engine: `openai-compatible`, `claude-cli`, `codex-cli` and `grok-cli`. |
724
731
  | `imageReview` | `never`, `always` | `never` | `always` feeds each generated image back to the agent so it can judge it, about 2k tokens per image. Not a lock: the agent can set `return_image` per call either way. |
725
- | `agentLoop.maxRounds` | integer | server value (8) | Rounds per turn on the `openai-compatible` engine. Builders default to 500. |
732
+ | `agentLoop.maxRounds` | integer | server value (8) | Rounds per turn on the `openai-compatible` engine. Builders have none unless set. |
726
733
  | `agentLoop.maxToolCallsPerTurn` | integer | server value (30) | Tool calls per turn, across all rounds. Builders default to 2000. |
727
734
  | `agentLoop.maxTurnMs` | integer | none | Time limit per turn in milliseconds. Builders default to 8 hours. |
728
735
 
@@ -810,7 +817,7 @@ an `openai-compatible` provider.
810
817
  | `agentLoop.longTaskMaxTimeoutMs` | `1800000` | Longest wait. |
811
818
  | `agentLoop.wakeGraceMs` | `3000` | Delay before a wake turn. 0 to 60000. |
812
819
  | `agentLoop.toolUsageReminder` | `true` | The tool reminder in the prompt. |
813
- | `subagents.tools.deny` | `[agent_ask, agent_ask_result, agent_ask_cancel]` | Tools a sub-agent session never gets. See [What a sub does not get](#what-a-sub-does-not-get). |
820
+ | `subagents.tools.deny` | `[agent_ask, agent_ask_result, agent_ask_cancel, builder_review]` | Tools a sub-agent session never gets. See [What a sub does not get](#what-a-sub-does-not-get). |
814
821
  | `promptBudgets.personaFileChars` | `8000` | Budget for each of `AGENTS.md`, `SOUL.md`, `USER.md`. |
815
822
  | `promptBudgets.personaTotalChars` | `14000` | Budget for the three together. |
816
823
  | `promptBudgets.teamBlockChars` | `3000` | Budget for the team block. |
package/docs/api.md CHANGED
@@ -439,7 +439,7 @@ whether the file is valid, and whether the server can restart itself.
439
439
  "loadedAt": "2026-05-14T11:09:08.429Z",
440
440
  "changedOnDisk": false,
441
441
  "restartRequiredSections": ["server", "memory", "obsidian", "wiki", "mcp",
442
- "claudeCli", "codexCli", "stt", "tts", "sentinel", "updateCheck",
442
+ "browser", "claudeCli", "codexCli", "stt", "tts", "sentinel", "updateCheck",
443
443
  "tmux", "web", "mobile"],
444
444
  "restartAvailable": true }
445
445
  ```
@@ -469,6 +469,78 @@ A reload also forgets every "model unavailable" mark, like
469
469
  `POST /models/availability/reset`, and every cached provider catalog
470
470
  of image and video models: the next request reads them fresh.
471
471
 
472
+ ### Settings
473
+
474
+ The settings window's routes (web.md "The settings window"). Keys and
475
+ passwords never leave the server: in `values` they are
476
+ `{secret: true, set}`, in the YAML text `•••• (set)`.
477
+
478
+ #### `GET /settings`
479
+
480
+ `{path, hash, valid, issues?, groups, restartSections, fields, values, inFile, envSet, refOptions?}`.
481
+
482
+ | Field | Content |
483
+ |---|---|
484
+ | `hash` | The file's state; `POST /settings/apply` needs it back. |
485
+ | `groups` | `{id, title, icon, sections, ready}`. A group that is not `ready` is read only. |
486
+ | `fields` | One per setting: `{path, kind, section, default?, enum?, min?, max?, minExclusive?, nullable?, required?, valueKind?, info?}`. `kind` is `boolean`, `integer`, `number`, `string`, `enum`, `strings`, `one-or-many`, `boolean-or-strings` (on, off or a list of names), `object`, `map` or `list`. `*` in `path` stands for an entry name. `valueKind` belongs to a `map` of plain values and says what each value is (`string`, `number`, `integer` or `boolean`; a header is a `string`). `info` is `{label, help, more?, level, sensitive?, unit?, docs?, placeholder?, locked?, retired?, ref?}`: `locked` gives the reason a setting is not changed here, `retired` marks one somora no longer reads. |
487
+ | `values` | The configuration in force, defaults filled in; `null` when the file does not validate. |
488
+ | `inFile` | Dotted paths the file itself sets, entries of lists by index. |
489
+ | `envSet` | Settings an environment variable overrides, as `{path: variable}`. They cannot be changed here. |
490
+ | `refOptions` | The names a reference can take, by kind: `model` (aliases and `provider/id`), `provider`, `image-model`, `video-model`, `decision-model`. A field's `info.ref` names its kind. Sent only when the file validates. |
491
+
492
+ #### `POST /settings/test-model`
493
+
494
+ Body `{provider, model}` (the model's id); without both, 400. Asks an
495
+ openai-compatible model of the saved configuration one short question,
496
+ with the model's saved reasoning default and sampling, as a chat turn
497
+ sends them: `{ok, ms, reply?, error?}`. A provider or model that is not
498
+ in the saved configuration gives `{ok: false, error}` without `ms`. For
499
+ a model on another engine `{ok: false, note}`; it is not asked.
500
+
501
+ #### `GET /settings/yaml`
502
+
503
+ `{path, hash, text}`: the file as it is on disk, keys blanked.
504
+
505
+ #### `POST /settings/apply`
506
+
507
+ Body `{hash, changes: [...]}`, each change `{path, value}`, `{path,
508
+ reset: true}` (back to the default: the line is removed) or `{path,
509
+ secret}`.
510
+
511
+ A path may name an entry of a map or list
512
+ (`mcp.servers.<name>`, `imageGen.models.3`) to add it with an object
513
+ value or remove it with `reset`, or a field inside one
514
+ (`mcp.servers.<name>.headers.Authorization`). List indexes mean the
515
+ entries as the file has them; a name with a dot of its own is
516
+ written with `%2E` (`toolCatalog.models.gpt-5%2E5`).
517
+
518
+ A value carrying `{secret: true, set}` is refused, and so is a change that removes a model, provider or
519
+ named model still in use (an agent's model, fallback or own REM worker models, or a setting
520
+ that names it); `issues` says who uses it.
521
+
522
+ Only the changed lines are written; comments and layout
523
+ stay. Before writing, the file is saved to `~/.somora/config-backups/`
524
+ (the last 20 stay); after it, the configuration is reloaded as by
525
+ `POST /config/reload`.
526
+
527
+ | Status | Body |
528
+ |---|---|
529
+ | `200` | `{ok: true, hash, backup, reload}`. `reload` is the answer of the reload. Changes that leave the file as it was give `{ok: true, hash, unchanged: true}`: nothing written, no backup. |
530
+ | `400` | `{error, issues: [{path, message}]}`: an unknown setting, one of a group that is not ready, one an environment variable sets, a locked setting (also when its whole block is sent), a retired setting changed other than by `reset`, a change with none of `value`, `reset` or `secret`, a value the schema refuses, or the removal of a name still in use. An edit the file cannot take gives `{error}` alone. Nothing was written. |
531
+ | `409` | `{error, hash}`: the file changed since `hash`. Nothing was written. |
532
+
533
+ #### `GET /settings/backups`
534
+
535
+ `{backups: [{name, at, bytes}], keep}`, newest first.
536
+
537
+ #### `POST /settings/restore`
538
+
539
+ Body `{name, hash}`. Writes that backup back after checking it, keeps
540
+ the current file as a backup too, and reloads. `400` for a name that
541
+ is not a backup or a version that does not validate, `404` for a backup
542
+ that is not there, `409` as above.
543
+
472
544
  ### `POST /server/restart`
473
545
 
474
546
  Restarts the server through its service manager: the systemd user unit
@@ -654,8 +726,10 @@ Response `200`, the turn result:
654
726
  |---|---|
655
727
  | `finalText` | The reply. |
656
728
  | `outcome` | `completed`, `partial`, `degraded` or `failed`. `outcome_reason` and `error` explain the last three. |
657
- | `tool_calls`, `rounds`, `ms` | How much work the turn was. |
729
+ | `tool_calls`, `rounds`, `ms` | How much work the turn was. For a builder sent back to open work, `tool_calls`, `files_written` and `tools_used` cover the follow-up turns too, and `finalText` is the last turn's report ([Builder](builder.md#when-the-builder-wants-to-stop)). |
658
730
  | `files_written`, `media` | Files and generated media of the turn, when there are any. |
731
+ | `tools_used` | The tools the turn called, each once, by their registry name. |
732
+ | `engine`, `agentKind` | The engine that ran the turn (`claude-cli`, `codex-cli`, `grok-cli`, `openai-compatible`) and the agent's kind (`chat` or `builder`). |
659
733
  | `follow_ups` | Texts that reached the caller after the report. See `GET /spawn-result`. |
660
734
  | `usage`, `contextWindow`, `provider`, `model` | Tokens and the model that answered. `fallback` is added when a backup model answered. |
661
735
  | `thinkingActive`, `thinkingLevel` | Whether a thinking level was applied. |
@@ -786,7 +860,7 @@ Every event has `kind` and `ts`. The kinds:
786
860
  | `model_fallback` | A backup model answered. Stands before the assistant message it produced. |
787
861
  | `assistant_audio`, `assistant_media` | Spoken audio and generated media of a turn, paired by `turnId`. |
788
862
  | `project_switched` | The session's project changed. |
789
- | `error` | An error text. |
863
+ | `error` | An error text. `contextOverflow: true` when the conversation did not fit the model's window even after compacting; a backup model with a window no larger is then skipped. |
790
864
  | `turn_start`, `turn_end` | Bookkeeping around a turn. |
791
865
 
792
866
  `400` when `agent` or `session` is missing or `before` is not a number.
@@ -894,7 +968,7 @@ All events:
894
968
  | `memory` | After `agent` start: what recall put into the turn | `{count, topScore?, refs, fullText}` |
895
969
  | `thinking` | The model's reasoning text | `{state: "delta"\|"final", text, truncated?}` |
896
970
  | `chat` | The reply text | `{state: "delta"\|"final", text}` |
897
- | `tool` | A tool is called, returns or fails | `{phase: "call"\|"result"\|"error", tool, summary?, details?, error?}` |
971
+ | `tool` | A tool is called, returns or fails | `{phase: "call"\|"result"\|"error", tool, callId, summary?, details?, error?}`. `callId` pairs a result with its call. |
898
972
  | `engine_meta` | A side note of the engine or of somora | `{engine, itemType, label, summary?, payload}` |
899
973
  | `model_fallback` | A backup model takes over the turn | `{requested, actual, reason, hops?}` |
900
974
  | `turn_error` | The turn ended with an error | `{turnId?, message, engine}` |
@@ -904,6 +978,7 @@ All events:
904
978
  | `project` | The session's project changed | `{from, to, via}` |
905
979
  | `builder_state` | A builder session's mode, phase or plan file changed | `{mode, phase, planPath}` |
906
980
  | `todo_updated` | A builder replaced its task list | `{todos: [{content, status, priority?}], by?}` |
981
+ | `acceptance_updated` | A builder wrote its acceptance list, an item was reviewed, or the list became required or optional | `{items: [{id, requirement, status, evidence?, updatedAt, review?}], required, by?}`. `by` is the builder, `person` or the reviewing agent; absent when only `required` changed. |
907
982
  | `question_asked` | An agent asks the person | `{questionId, question, header?, options, multiple, expiresAt, kind?, from?, async?, parts?, source?}`. `kind: "permission"` and `from: "external"` mark an external agent asking to run something; each option's `description` is then its kind (`allow_once`, `reject_once`, …). `async: true` marks a question that does not wait (`expiresAt` is `0`); `parts` lists several questions asked at once, `source` is `ask_user`, or `codex` for Codex's own question tool. |
908
983
  | `question_answered` | The open question was answered, replaced or ran out of time | `{questionId?, answered, choice?, by?}`. `by: "message"`: a question that does not wait, answered by writing something else. |
909
984
 
@@ -1033,12 +1108,17 @@ most notes have a readable `payload.text`.
1033
1108
  | `thread_recreated` | The Codex thread was gone. A new one was started with the history replayed. |
1034
1109
  | `tools_changed` | The agent's tool set changed, so a new Codex thread was started with the history replayed. |
1035
1110
  | `mcp_server_renamed` | The engine session was rebuilt (label `session restarted`). |
1036
- | `context_compacted` | The history was compacted: by somora before a turn (`payload.reason: "auto"`, with `contextBefore`, `contextAfter` and `contextWindow` in tokens), during a turn, after the backend refused the prompt (`"context_overflow"`), or by the engine itself (`"engine_side"`). A compaction by hand has engine `somora`, see below. |
1111
+ | `context_compacted` | The history was compacted: by somora before a turn (`payload.reason: "auto"`, with `contextBefore`, `contextAfter` and `contextWindow` in tokens; for a builder also `builderTarget`, `reachedTarget` and `freeTokens`), during a turn, after the backend refused the prompt (`"context_overflow"`), when the first request did not fit even trimmed and the turn starts over on the same model (`"context_budget"`), or by the engine itself (`"engine_side"`). A compaction by hand has engine `somora`, see below. |
1037
1112
  | `context_trimmed` | The oldest tool results of the running turn were shortened to fit the window. The turn goes on. |
1038
1113
  | `attachments_unsupported` | The engine cannot pass attachments on. |
1039
1114
  | `session_model` | An agent switched this session's model (label `model switched`). |
1040
1115
  | `voice_handover`, `voice_spoken` | A call was handed to or from another agent. What a call said out loud, in older sessions. |
1116
+ | `voice_call_record` | One realtime voice call (engine `voice`, label `call record`), written when the call ends and, for the part before a move, into the session it left. Off with `realtimeVoice.keepTranscript: false`. `payload` has `text` (one line: length, line count, reason), `startedAt`, `endedAt` (ms), `reason`, `voice` and `lines`: `{at, who, text}` with `at` in ms since the call started and `who` `caller`, `voice` or `event` (interruptions, questions to the agent, notices, errors). A `voice` line of an interrupted answer ends in ` (cut off)`. |
1041
1117
  | `reasoning_effort_adjusted`, `sampling_dropped` | The backend refused a parameter and the turn was retried without it. |
1118
+ | `doom_loop_notice`, `doom_loop_stop` | The same tool calls three rounds in a row: the model was told to change course (label `loop noticed`). Five rounds: the turn was stopped (`loop stopped`). |
1119
+ | `budget_checkpoint` | A builder used 75 % of its turn budget and was told to save its progress and keep working. `payload` has `round`, `toolCalls`, `maxRounds` (`null` without a round cap) and `maxToolCallsPerTurn`. |
1120
+ | `open_tasks_notice` | A builder on openai-compatible wanted to end its turn with open items on its task list and was told to continue or to name the blocker (label `open tasks`). Also when acceptance items are open or the required list is missing. `payload` has `round`, `open` (task items), `acceptanceOpen`, `acceptanceMissing` (only when true) and `attempt` (1 or 2). On claude-cli, codex-cli and grok-cli the builder gets a follow-up turn instead: a `user_message` with `origin` `{kind: "wake", about: "system", cause: "open items"}`. |
1121
+ | `answer_cut_off` | A builder's answer was cut off by the output limit and it was told to continue where it stopped (label `answer cut off`). `payload` has `round` and `attempt` (1 or 2). |
1042
1122
 
1043
1123
  An unknown `itemType` keeps its raw name as label.
1044
1124
 
@@ -1056,7 +1136,7 @@ curl -H "Authorization: Bearer $KEY" -N $BASE/activity/stream
1056
1136
  |---|---|---|
1057
1137
  | `status` | On connect | `{msg: "connected"}` |
1058
1138
  | `heartbeat` | Every `sse.heartbeatMs` | The current time in ms |
1059
- | `streaming` | A turn starts or ends on any session | `{agent, session, phase: "start"\|"end"}` |
1139
+ | `streaming` | A turn starts or ends on any session. Right after `status`, one `start` for every session already working. | `{agent, session, phase: "start"\|"end"}` |
1060
1140
  | `turn` | Something a person should read arrived in a session | `{agent, session, unreadAt}` |
1061
1141
  | `seen` | A client marked a session as seen | `{agent, session, seenAt}` |
1062
1142
 
@@ -1546,7 +1626,7 @@ every client edits the same way. Body:
1546
1626
 
1547
1627
  Returns `{ok: true, gating}` with the rules now in `agent.yaml`. Only
1548
1628
  the named entries change state. `400` for a wrong body, an unknown
1549
- name, or a builder-only tool (`todo_write`, `plan_write`) for a chat
1629
+ name, or a builder-only tool (`todo_write`, `plan_write`, `acceptance_write`) for a chat
1550
1630
  agent. `409` with `lockedBy: "dreams"` for a tool that
1551
1631
  follows the dreams switch. `404` for an unknown agent. Clicks on one agent run
1552
1632
  one after another, and each write keeps the previous `agent.yaml` as a
@@ -1672,13 +1752,15 @@ The outcome of one agent's question to another, by call id.
1672
1752
  { "call_id": "…", "state": "done", "target_agent": "<other-agent>",
1673
1753
  "target_session": "20260906-172957_research", "started_at": 1788000000000,
1674
1754
  "finished_at": 1788000042000, "response": "…", "outcome": "completed",
1675
- "source": "registry" }
1755
+ "model": "<provider>/<model>", "source": "registry" }
1676
1756
  ```
1677
1757
 
1678
1758
  | Field | Meaning |
1679
1759
  |---|---|
1680
1760
  | `state` | `queued`, `running`, `done` or `failed`. Read from history it can also be `unknown`: the turn never ended. |
1681
1761
  | `response`, `outcome` | The reply and the turn's outcome, once done. |
1762
+ | `model` | `provider/model` that produced the reply. Read from history, it comes from the turn's end. |
1763
+ | `fallback` | `{requested, reason}` when a backup model answered instead of the one asked for. Absent otherwise. |
1682
1764
  | `error` | Why it failed. `stopped by the user` and `removed from the queue by the user before it started` mean a person intervened. An agent should not retry those by itself. |
1683
1765
  | `source` | `registry` (in memory) or `history` (read from the target session). |
1684
1766
 
@@ -1809,7 +1891,7 @@ that had already ended are skipped. `404` for an unknown id.
1809
1891
  Agents of kind `builder` keep a mode, a phase, a plan file and a task
1810
1892
  list per session, and at most one open question to the person. The web
1811
1893
  client's task panel uses these routes, and so do the builder's own
1812
- tools `todo_write` and `plan_write`.
1894
+ tools `todo_write`, `plan_write` and `acceptance_write`.
1813
1895
 
1814
1896
  `POST …/ask` (the `ask_user` tool) serves every agent. A builder waits,
1815
1897
  30 minutes by default. For a chat agent: in a turn nobody watches it
@@ -1826,6 +1908,11 @@ The builder state of a session.
1826
1908
  "state": { "mode": "attended", "phase": "plan",
1827
1909
  "planPath": "/home/me/code/acme/PLAN.md",
1828
1910
  "todos": [ { "content": "Write the parser", "status": "pending" } ] },
1911
+ "acceptance": { "required": true,
1912
+ "items": [ { "id": "A01", "requirement": "A rejected result is never shown as completed",
1913
+ "status": "passed", "evidence": "npm test gate.test: rejected → failed",
1914
+ "updatedAt": 1789299998000 } ] },
1915
+ "writeAllow": [],
1829
1916
  "question": null,
1830
1917
  "turn": { "turnId": "…", "startedAt": 1789299991000, "toolCalls": 7,
1831
1918
  "lastTool": "file_write", "lastToolAt": 1789299999000 } }
@@ -1834,19 +1921,24 @@ The builder state of a session.
1834
1921
  | Field | Meaning |
1835
1922
  |---|---|
1836
1923
  | `state` | `{mode, phase, planPath, todos, orderer?}`, or `null` before the session's first turn. `mode` is `attended` or `unattended`, `phase` is `plan` or `build`. |
1924
+ | `acceptance` | `{items, required}`: the acceptance list (see below) and whether the session requires it. |
1925
+ | `writeAllow` | Folders the builder may write in besides the project: set by the orderer or by "Allow this folder for the session". |
1837
1926
  | `question` | `{questionId, question, header?, options: [{label, description?}], multiple, askedAt, expiresAt}` or `null`. Also carries the question a builder raises before writing outside its project folder. |
1838
1927
  | `turn` | Progress of the running turn, else `null`. |
1839
1928
 
1840
1929
  ### `PATCH /agents/:agent/sessions/:session/builder`
1841
1930
 
1842
- Changes mode, phase or plan file. Sends `builder_state`.
1931
+ Changes mode, phase or plan file. Sends `builder_state`, and
1932
+ `acceptance_updated` when `acceptanceRequired` is in the body.
1843
1933
 
1844
1934
  | Body field | Meaning |
1845
1935
  |---|---|
1846
1936
  | `mode` | `attended` or `unattended`. |
1847
1937
  | `phase` | `plan` or `build`. |
1848
1938
  | `planPath` | An absolute path, or `null` to clear it. |
1849
- | `orderer` | `{agent, session?}`: the agent that handed the order over. Set by `builder_dispatch`. |
1939
+ | `orderer` | `{agent, session?}`: the agent that handed the order over. Set by `builder_dispatch`, or else by the first agent that writes into the session. |
1940
+ | `acceptanceRequired` | `true` makes the acceptance list required for this session, `false` optional. The panel's list switch sends it. A message from another agent turns it on by itself (`agent_ask`, `builder_dispatch`, an A2A peer). |
1941
+ | `writeAllow` | Absolute folders the builder may also write in, added to those already allowed. At most 4 per request. Each must exist and be narrow: not `/`, not the home folder, not a folder holding the project, not inside somora's home. Needs a pinned project. Set by `builder_dispatch` `write_allow`. |
1850
1942
 
1851
1943
  Returns `{agent, session, state}`. `400` for a value outside these.
1852
1944
 
@@ -1876,6 +1968,49 @@ Replaces the whole task list. Sends `todo_updated`.
1876
1968
 
1877
1969
  Returns `{agent, session, todos}`.
1878
1970
 
1971
+ ### `GET /agents/:agent/sessions/:session/acceptance`
1972
+
1973
+ The acceptance list: `{agent, session, items, required}`. Each item is
1974
+ `{id, requirement, status, evidence?, updatedAt, review?}`. `status` is
1975
+ `open`, `passed`, `failed` or `not_run`. `review` is `{verdict:
1976
+ "accepted" | "rejected", by, note?, at}`.
1977
+
1978
+ ### `PUT /agents/:agent/sessions/:session/acceptance`
1979
+
1980
+ Writes the list. Used by `acceptance_write`, sends `acceptance_updated`.
1981
+
1982
+ | Body field | Meaning |
1983
+ |---|---|
1984
+ | `items` | `[{id, requirement?, status, evidence?}]`, at most 60. A new item needs `requirement`. |
1985
+ | `by_agent` | Who writes it. Another agent than the builder gets `403`. |
1986
+
1987
+ The answer is `{items, required, warnings}`. The merge keeps the list
1988
+ whole:
1989
+
1990
+ - an item left out stays,
1991
+ - an existing requirement keeps its first wording,
1992
+ - `accepted` or `rejected` as a status is refused,
1993
+ - a new status or new evidence clears the item's review,
1994
+ - when `required` is true, `passed` or `failed` without `evidence`, or
1995
+ `not_run` without the reason in `evidence`, is refused: the item keeps
1996
+ its status and evidence.
1997
+ - an item sent again with the same status and no `evidence` keeps its
1998
+ evidence and its review.
1999
+
2000
+ `warnings` names each of these. Without `required`, `passed` or
2001
+ `failed` without evidence is only a warning. `400` for a chat agent.
2002
+
2003
+ ### `POST /agents/:agent/sessions/:session/acceptance/review`
2004
+
2005
+ Reviews one item. Sends `acceptance_updated`.
2006
+
2007
+ | Body field | Meaning |
2008
+ |---|---|
2009
+ | `id` | The item. `404` when the list has no such item. |
2010
+ | `verdict` | `accepted` or `rejected`. |
2011
+ | `note` | Optional, up to 1000 characters. |
2012
+ | `by_agent` | Optional. Without it the review is the person's (`by: "person"`). With it, it must be the session's orderer; the builder itself and any other agent get `403`. An item the person reviewed gets `409` until the builder sends new evidence. |
2013
+
1879
2014
  ### `PUT /agents/:agent/sessions/:session/plan`
1880
2015
 
1881
2016
  Writes the session's plan file. Body `{content}`.
@@ -2873,7 +3008,7 @@ Server to client:
2873
3008
  | `{"type": "ready", "call", "rateHz": 24000}` | The call is up. |
2874
3009
  | `{"type": "audio", "base64", "rateHz"}` | Speech to play. |
2875
3010
  | `{"type": "state", "call"}` | The call's state changed. |
2876
- | `{"type": "event", "event", "call"}` | Something happened. `event.kind` is `user_speech`, `user_transcript`, `model_speech`, `model_transcript`, `tool_call`, `interrupted`, `usage`, `closed` or `error`. |
3011
+ | `{"type": "event", "event", "call"}` | Something happened. `event.kind` is `ready` (the provider session is up), `user_speech`, `user_transcript`, `model_speech`, `model_transcript`, `tool_call`, `interrupted`, `usage`, `notice` (`message`: a warning from the voice service, each once), `closed` or `error` (`message`, `fatal`). `model_transcript` carries `responseId` when the service names its answers. |
2877
3012
 
2878
3013
  `call` is `{id, target, state, startedAt, consults, spokenTurns, handoverTo?, lastError?}`.
2879
3014
  `state` is `connecting`, `listening`, `consulting`, `speaking` or