rewire daemon services on project open
test / unit + widget + golden + a11y (push) Failing after 27s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped

The daemon dispatcher (pql, git, files, editor) was built once at
boot against cwd and never updated. Opening a project from the
welcome screen or directory picker had no effect on the daemon
services — pql couldn't find its index, git operated on the wrong
repo.

Now onProjectOpen rebuilds the full dispatcher against the new
workspace root and swaps it into the InProcessClient. The IPC
client's dispatcher field is no longer final.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-03 22:29:03 +02:00
co-authored by Claude
parent a5221792ba
commit 7b30748bf5
3 changed files with 138 additions and 118 deletions
+8 -4
View File
@@ -8,10 +8,14 @@ class InProcessClient extends DaemonClient {
InProcessClient({
required Logger log,
required DaemonBus events,
required this.dispatcher,
}) : super(socketPath: '', log: log, events: events);
required DaemonDispatcher dispatcher,
}) : _dispatcher = dispatcher,
super(socketPath: '', log: log, events: events);
final DaemonDispatcher dispatcher;
DaemonDispatcher _dispatcher;
DaemonDispatcher get dispatcher => _dispatcher;
set dispatcher(DaemonDispatcher d) => _dispatcher = d;
int _nextReqId = 0;
@override
@@ -27,6 +31,6 @@ class InProcessClient extends DaemonClient {
Future<IpcResponse> request(String cmd, {Map<String, Object?> args = const {}}) {
final id = '${_nextReqId++}';
final req = IpcRequest(id: id, cmd: cmd, args: args);
return dispatcher.dispatch(req);
return _dispatcher.dispatch(req);
}
}