@@ -94,19 +94,16 @@ shapes and sometimes collapse rich errors into opaque strings.
9494
9595### Problems
9696
97- - Some expected service failures still use ` NamedError.create(...) ` .
98- - Some expected service failures still become ` Effect.die(...) ` , which
99- makes them defects instead of typed, recoverable failures.
100- - CLI and HTTP boundaries can render structured errors as generic
101- ` Error: SomeName ` output.
102- - HTTP error middleware still guesses status codes from error names like
103- ` Worktree* ` or ` ProviderAuthValidationFailed ` .
97+ - Some expected service failures still use ` NamedError.create(...) ` or
98+ collapse to ` Effect.die(...) ` . The storage/worktree/provider-auth
99+ conversions are done; an inventory sweep is needed for the rest.
100+ - HTTP error middleware still guesses status codes from error names —
101+ some entries (e.g. storage ` NotFound ` , provider auth) can now be
102+ removed, but the middleware overall has not shrunk.
104103- Route handlers and route groups do not consistently declare the public
105104 error body they intend to expose.
106105- Repeated route error translations do not yet have a clear home: some
107106 should stay inline, some deserve tiny shared mapper helpers.
108- - Unknown 500s should log full detail server-side while returning a safe
109- public body.
110107
111108### Target Shape
112109
@@ -126,19 +123,33 @@ shapes and sometimes collapse rich errors into opaque strings.
126123- Generic HTTP middleware should shrink; it should not accumulate more
127124 name-based domain knowledge.
128125
126+ ### Recently completed
127+
128+ - [x] ` RENDER-1 ` CLI tagged config error rendering (#27256 , tests #27257 ).
129+ - [x] ` ERR-1 ` [ ` storage/storage.ts ` ] ( ../../src/storage/storage.ts ) typed
130+ ` NotFoundError ` (#27265 ) and removal of the server defect fallback
131+ (#27287 ).
132+ - [x] ` ERR-2 ` [ ` worktree/index.ts ` ] ( ../../src/worktree/index.ts ) typed
133+ errors (#27296 ).
134+ - [x] ` ERR-3 ` [ ` provider/auth.ts ` ] ( ../../src/provider/auth.ts ) typed
135+ validation/oauth errors (#27301 ).
136+ - [x] ` HTTP-1 ` Unknown-500 details no longer leaked (#27251 ); follow-up
137+ to stop exposing named defects (#27471 ).
138+ - [x] Session message reads typed and made effectful (#27269 , #27275 ,
139+ #27280 , #27291 ).
140+ - [x] Session HTTP error contracts tightened (#27308 ); busy-session
141+ mapping centralized (#27375 , #27473 ).
142+ - [x] Provider init (#27484 ) and LSP init (#27494 ) errors typed.
143+
129144### First PR Candidates
130145
131- - [ ] ` RENDER-1 ` Fix CLI top-level rendering for typed config errors.
132- - [ ] ` ERR-1 ` Convert [ ` storage/storage.ts ` ] ( ../../src/storage/storage.ts )
133- not-found errors.
134- - [ ] ` ERR-2 ` Convert [ ` worktree/index.ts ` ] ( ../../src/worktree/index.ts )
135- errors and remove matching HTTP name checks where possible.
136- - [ ] ` ERR-3 ` Convert [ ` provider/auth.ts ` ] ( ../../src/provider/auth.ts )
137- validation errors.
138- - [ ] ` HTTP-1 ` Remove the unknown-500 stack leak from
139- [ ` middleware/error.ts ` ] ( ../../src/server/routes/instance/httpapi/middleware/error.ts ) .
140146- [ ] ` HTTP-2 ` Audit one route group for explicit error contracts and
141147 decide which mappings stay inline vs. shared helper.
148+ - [ ] ` ERR-4 ` Sweep remaining ` NamedError.create(...) ` and
149+ ` Effect.die(...) ` callsites for expected failures — re-run `git
150+ grep` to build a current inventory.
151+ - [ ] ` RENDER-2 ` Audit CLI and TUI surfaces for any remaining opaque
152+ ` Error: Name ` rendering of typed errors.
142153
143154## P1: Tests
144155
@@ -163,26 +174,24 @@ Recently completed:
163174- [x] Built-in websearch provider selection uses the same runtime flags as
164175 tool visibility.
165176- [x] Removed global default-plugin disabling from test preload.
166-
167- Recommended next PRs:
168-
169- ``` text
170- RF-1 scout consumers ─┐
171- ├─ can run in parallel
172- RF-2 plan-mode prompt ┘
173- └─ RF-3 event-system cluster, stacked only if RF-2 still touches prompt.ts
174-
175- RF-4 workspaces cluster: later, after mutable Flag tests are cleaned up
176- ```
177-
178- - [ ] ` RF-1 ` Move scout reads in [ ` agent.ts ` ] ( ../../src/agent/agent.ts )
179- and [ ` reference.ts ` ] ( ../../src/reference/reference.ts ) .
180- - [ ] ` RF-2 ` Move plan-mode prompt read in
181- [ ` session/prompt.ts ` ] ( ../../src/session/prompt.ts ) .
182- - [ ] ` RF-3 ` Move event-system reads in session prompt/processor/
183- compaction and TUI debug plugin.
184- - [ ] ` RF-4 ` Move workspaces reads in session/sync/control-plane after
185- tests stop relying on mutable ` Flag ` timing.
177+ - [x] ` RF-1 ` Scout reads routed through runtime flags (#27318 ).
178+ - [x] ` RF-2 ` Plan-mode prompt read routed through runtime flags (#27320 ).
179+ - [x] ` RF-3 ` Event-system reads routed through runtime flags (#27323 ).
180+ - [x] ` RF-4 ` Workspaces reads routed through runtime flags for session
181+ (#27335 ), sync (#27336 ), and control-plane (#27337 ).
182+ - [x] LLM client (#27368 ) and installation client (#27369 ) routed
183+ through runtime flags.
184+ - [x] TUI plugin runtime flags simplified (#27506 ).
185+ - [x] Background-subagents flag moved to RuntimeFlags, then removed
186+ (` refactor(task): use runtime flag for background subagents ` ,
187+ ` refactor(flags): remove background subagents flag ` ).
188+
189+ Remaining cleanup:
190+
191+ - [ ] Sweep lingering ` Flag.* ` reads — many CLI/TUI/config/observability
192+ callsites still import [ ` flag.ts ` ] ( ../../../core/src/flag/flag.ts ) .
193+ Decide per-callsite whether to route through RuntimeFlags, accept
194+ as legitimate env/config boundary, or migrate to typed ` Config ` .
186195- [ ] Delete [ ` test/fixture/flag.ts ` ] ( ../../test/fixture/flag.ts ) once
187196 tests no longer mutate ` Flag ` .
188197- [ ] Delete [ ` flag.ts ` ] ( ../../../core/src/flag/flag.ts ) once no packages
0 commit comments