Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

refactor: add injectable seams for observability, research runtime, and timers

2 months ago

b58828a
Authored
Max Weinbach7/14/2026, 2:30:27 AM
All seams are optional options defaulting to current behavior:
- emitObservabilityEventImpl threaded from StartAgentServerOptions through
  SessionRegistry/AgentSession so tests capture telemetry without
  mock.module-ing src/observability/otel (Bun module mocks leak process-wide).
- ResearchService/ResearchFileStore runtime option for the Google research
  calls, replacing the researchRuntime module mock that shadowed
  research-runtime.test.ts's real coverage.
- pluginInstallEventsTimeoutMs, MemoryPage loadingStallMs, control-socket
  pollIntervalMs, and useCreationReadiness runtimeRecheckDelayMs so tests
  stop sleeping out real 1-60s production timers; fixed sleeps in the
  slowest test files replaced with event-driven or polled waits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Parentfe9fbb3

27 files changed
  • apps/desktop/src/app/store.helpers/controlSocket.ts+5−2
  • apps/desktop/src/ui/creation/useCreationReadiness.ts+10−3
  • apps/desktop/src/ui/settings/pages/MemoryPage.tsx+9−4
  • apps/desktop/test/canvas-hooks-stability.test.tsx+6−1
  • apps/desktop/test/control-socket.mcp-auth-refresh.test.ts+11−5
  • apps/desktop/test/creation-readiness-refresh.test.tsx+15−8
  • apps/desktop/test/memory-page.test.ts+13−7
  • apps/desktop/test/sidebar-ui.test.tsx+20−1
  • apps/desktop/test/web-transcript-delivery.test.ts+4−1
  • src/server/jsonrpc/routes/plugins.ts+5−3
  • src/server/jsonrpc/routes/types.ts+5−0
  • src/server/research/ResearchService.ts+33−7
  • src/server/research/researchFileStore.ts+25−4
  • src/server/runtime/ServerRuntime.ts+17−1
  • src/server/runtime/SessionRegistry.ts+2−0
  • src/server/session/AgentSession.ts+2−0
  • src/server/session/AgentSessionFromPersisted.ts+2−0
  • src/server/session/SessionContext.ts+7−0
  • src/server/session/SessionRuntimeSupport.ts+3−1
  • test/jsonrpc/control.plugins.test.ts+61−24
  • test/jsonrpc/flow.task-terminal-locks.test.ts+17−16
  • test/platform/proc.test.ts+23−8
  • test/research/research.harness.ts+22−3
  • test/session.stream-pipeline.test.ts+2−8
  • test/session/agentSession.harness.ts+4−5
  • test/session/agentSession.messaging.test.ts+38−19
  • test/session/agentSession.usage.test.ts+37−21