Skip to content

Realtime chat and document editing demo#4618

Draft
samwillis wants to merge 40 commits into
mainfrom
codex/draft-realtime-agents-markdown-docs
Draft

Realtime chat and document editing demo#4618
samwillis wants to merge 40 commits into
mainfrom
codex/draft-realtime-agents-markdown-docs

Conversation

@samwillis

Copy link
Copy Markdown
Contributor

Summary

This is a realtime chat and document editing demo that combines the realtime agents work with collaborative markdown document tools.

Builds on:

What changed

  • Keeps realtime sessions listening for inbox wake notifications while the user is in realtime mode.
  • Adds batched child-completion wake handling so parent agents receive all subagent completions, including fast workers whose manifest-backed wake registration arrives late.
  • Makes markdown document refs available through parent manifests when child workers create/edit documents.
  • Improves Horton/worker markdown-editing guidance and worker naming so spawned agents have descriptive names.
  • Keeps realtime audio sessions alive across split-panel document opens, so opening a markdown editor does not stop the session.
  • Labels markdown presence cursors with the agent entity name instead of the local dev principal.

Validation

  • pnpm install
  • pnpm --filter @electric-ax/agents-server exec vitest run test/wake-registry.test.ts -t "manifest"
  • pnpm --filter @electric-ax/agents-runtime exec vitest run test/markdown-docs-tools.test.ts
  • pnpm --filter @electric-ax/agents-runtime typecheck
  • pnpm --filter @electric-ax/agents-server typecheck
  • pnpm --filter @electric-ax/agents-runtime stylecheck
  • pnpm --filter @electric-ax/agents-server stylecheck
  • pnpm --filter @electric-ax/agents-server-ui exec vitest run src/lib/realtime-session-store.test.ts
  • pnpm --filter @electric-ax/agents exec vitest run test/spawn-worker-tool.test.ts test/horton-system-prompt.test.ts test/horton-tool-composition.test.ts
  • pnpm --filter @electric-ax/agents-server-ui typecheck
  • pnpm --filter @electric-ax/agents typecheck
  • git diff --check

samwillis added 30 commits June 17, 2026 10:47
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Electric Agents Desktop Builds

Build artifacts for commit c76a1ee.

Platform Status Artifact
macOS Apple Silicon Passed DMG
macOS Intel Passed DMG
Windows x64 Passed Installer
Linux x64 Passed AppImage / deb

Workflow run

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
2285 6 2279 41
View the top 3 failed test(s) by shortest run time
test/entity-timeline.test.ts > entity includes query > includes query reactivity > reasoning content remains populated after status flips to completed
Stack Traces | 0.000635s run time
QueryBuilderError: Invalid source for live query: The value provided for alias "realtimeTranscript" is not a Collection or subquery. Live queries only accept Collection instances or subqueries. Please ensure you're passing a valid Collection or QueryBuilder, not a plain array or other data type.
 ❯ BaseQueryBuilder._createRefsForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:149:15
 ❯ BaseQueryBuilder._createRefForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:94:23
 ❯ BaseQueryBuilder.from ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:177:27
 ❯ buildEntityTimelineQuery src/entity-timeline.ts:1587:6
 ❯ src/entity-timeline.ts:1502:38
 ❯ buildQuery ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:1370:18
 ❯ buildQueryFromConfig ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/utils.ts:261:9
 ❯ new CollectionConfigBuilder ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/collection-config-builder.ts:174:18
 ❯ liveQueryCollectionOptions ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:83:35
 ❯ Module.createLiveQueryCollection ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:191:21
test/entity-timeline.test.ts > entity includes query > includes query reactivity > reasoning content populates even when text deltas are also present
Stack Traces | 0.000692s run time
QueryBuilderError: Invalid source for live query: The value provided for alias "realtimeTranscript" is not a Collection or subquery. Live queries only accept Collection instances or subqueries. Please ensure you're passing a valid Collection or QueryBuilder, not a plain array or other data type.
 ❯ BaseQueryBuilder._createRefsForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:149:15
 ❯ BaseQueryBuilder._createRefForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:94:23
 ❯ BaseQueryBuilder.from ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:177:27
 ❯ buildEntityTimelineQuery src/entity-timeline.ts:1587:6
 ❯ src/entity-timeline.ts:1502:38
 ❯ buildQuery ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:1370:18
 ❯ buildQueryFromConfig ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/utils.ts:261:9
 ❯ new CollectionConfigBuilder ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/collection-config-builder.ts:174:18
 ❯ liveQueryCollectionOptions ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:83:35
 ❯ Module.createLiveQueryCollection ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:191:21
test/entity-timeline.test.ts > entity includes query > includes query reactivity > reasoning content survives multiple run-row updates in sequence
Stack Traces | 0.00107s run time
QueryBuilderError: Invalid source for live query: The value provided for alias "realtimeTranscript" is not a Collection or subquery. Live queries only accept Collection instances or subqueries. Please ensure you're passing a valid Collection or QueryBuilder, not a plain array or other data type.
 ❯ BaseQueryBuilder._createRefsForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:149:15
 ❯ BaseQueryBuilder._createRefForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:94:23
 ❯ BaseQueryBuilder.from ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:177:27
 ❯ buildEntityTimelineQuery src/entity-timeline.ts:1587:6
 ❯ src/entity-timeline.ts:1502:38
 ❯ buildQuery ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:1370:18
 ❯ buildQueryFromConfig ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/utils.ts:261:9
 ❯ new CollectionConfigBuilder ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/collection-config-builder.ts:174:18
 ❯ liveQueryCollectionOptions ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:83:35
 ❯ Module.createLiveQueryCollection ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:191:21
test/entity-timeline.test.ts > entity includes query > includes query reactivity > live items.text.content streams in even alongside reasoning (alias-collision regression)
Stack Traces | 0.0114s run time
QueryBuilderError: Invalid source for live query: The value provided for alias "realtimeTranscript" is not a Collection or subquery. Live queries only accept Collection instances or subqueries. Please ensure you're passing a valid Collection or QueryBuilder, not a plain array or other data type.
 ❯ BaseQueryBuilder._createRefsForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:149:15
 ❯ BaseQueryBuilder._createRefForSource ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:94:23
 ❯ BaseQueryBuilder.from ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:177:27
 ❯ buildEntityTimelineQuery src/entity-timeline.ts:1587:6
 ❯ src/entity-timeline.ts:1502:38
 ❯ buildQuery ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/builder/index.ts:1370:18
 ❯ buildQueryFromConfig ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/utils.ts:261:9
 ❯ new CollectionConfigBuilder ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../query/live/collection-config-builder.ts:174:18
 ❯ liveQueryCollectionOptions ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:83:35
 ❯ Module.createLiveQueryCollection ../../node_modules/.pnpm/@tanstack+db@0.6.7_typescript@5.9.3/node_modules/@.../src/query/live-query-collection.ts:191:21
test/process-wake.test.ts > processWake > collapses wake batches only until a later message batch and then handles the message next
Stack Traces | 0.205s run time
AssertionError: expected [ 'message:', …(2) ] to deeply equal [ 'message:', …(2) ]

- Expected
+ Received

  [
    "message:",
-   "wake:/child/second",
+   "wake:http://localhost:3000/test-agent/agent-1",
    "message:follow-up",
  ]

 ❯ test/process-wake.test.ts:2649:27
test/process-wake.test.ts > processWake > collapses consecutive pending wake batches into one handler pass using the newest wake
Stack Traces | 0.21s run time
AssertionError: expected [ 'message:', …(1) ] to deeply equal [ 'message:', 'wake:/child/second' ]

- Expected
+ Received

  [
    "message:",
-   "wake:/child/second",
+   "wake:http://localhost:3000/test-agent/agent-1",
  ]

 ❯ test/process-wake.test.ts:2487:27

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

Copy link
Copy Markdown
Contributor

Electric Agents Mobile Build

Local mobile checks ran for commit c76a1ee.

The EAS Android preview build was skipped because the mobile-eas-build label is not present.
Add the mobile-eas-build label to this PR to produce an installable preview build.

Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant