Skip to content

Remove child handle result APIs#4517

Merged
KyleAMathews merged 13 commits into
mainfrom
fix-child-text-tests
Jun 5, 2026
Merged

Remove child handle result APIs#4517
KyleAMathews merged 13 commits into
mainfrom
fix-child-text-tests

Conversation

@KyleAMathews
Copy link
Copy Markdown
Contributor

@KyleAMathews KyleAMathews commented Jun 5, 2026

Motivation

This removes the old child-handle result pattern where a parent could spawn/observe a child and then await entity.run / call entity.text() in the same handler invocation.

We want child coordination to happen via durable server wakes instead:

  • a parent spawns or observes a child with wake: { on: "runFinished", includeResponse: true }
  • the parent handler returns and can be shut down safely
  • when the child finishes, the server wakes the parent again with wake.payload.finished_child

Keeping an agent paused while it waits for child output is risky in serverless/function runtimes: the process may be suspended or shut down at any time. It also ties up the parent invocation and prevents the parent from returning to the runtime to handle other work. Durable wakes make child completion an explicit continuation point instead of an in-memory promise.

Summary

  • remove EntityHandle.run / EntityHandle.text() from the public runtime types
  • remove internal spawn resolveRun / rejectRun plumbing
  • update orchestration tests to continue from runFinished wake payloads instead of same-wake child output reads
  • update docs, skills, examples, and tests so response-producing child coordination uses:
    • initialMessage to start child work
    • wake: { on: "runFinished", includeResponse: true } to receive the result later
    • wake.payload.finished_child.response as the durable child response

Notes

  • shorthand wake support (wake: "runFinished") remains in the runtime type for compatibility
  • this PR removes shorthand usages from docs/examples/tests where a child response is needed, so examples consistently opt into includeResponse

Verification

  • pnpm --filter @electric-ax/agents-runtime typecheck
  • targeted runtime-dsl F1-F10 tests were run individually and printed passing results; Vitest often left worker processes alive after pass output in this worktree
  • audit search found no remaining shorthand wake: "runFinished" usages and no real removed child handle API references

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Electric Agents Desktop Builds

Build artifacts for commit ddfb05b.

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

Workflow run

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 5, 2026

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit a26f05c
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/6a22eb5390b7fb00084a435f
😎 Deploy Preview https://deploy-preview-4517--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.66%. Comparing base (b0030a1) to head (ddfb05b).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4517       +/-   ##
===========================================
- Coverage   69.32%   55.66%   -13.66%     
===========================================
  Files          77      300      +223     
  Lines        9277    33945    +24668     
  Branches     2896     9641     +6745     
===========================================
+ Hits         6431    18897    +12466     
- Misses       2828    15029    +12201     
- Partials       18       19        +1     
Flag Coverage Δ
packages/agents 71.78% <ø> (ø)
packages/agents-mobile 84.09% <ø> (?)
packages/agents-runtime 80.96% <100.00%> (?)
packages/agents-server 72.79% <ø> (-0.02%) ⬇️
packages/agents-server-ui 5.77% <ø> (?)
packages/electric-ax 46.42% <ø> (ø)
typescript 55.66% <100.00%> (-13.66%) ⬇️
unit-tests 55.66% <100.00%> (-13.66%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Electric Agents Mobile Build

Local mobile checks ran for commit ddfb05b.

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

@KyleAMathews KyleAMathews merged commit 7c62024 into main Jun 5, 2026
43 checks passed
@KyleAMathews KyleAMathews deleted the fix-child-text-tests branch June 5, 2026 16:44
kevin-dp added a commit that referenced this pull request Jun 8, 2026
Main commits absorbed during the rebase changed assumptions our PR
relied on:

- #4517 removed `.run` / `.text` from EntityHandle and `resolveRun` /
  `rejectRun` from SpawnHandleInfo. Strip those from the fork handle
  in setup-context.ts so it matches the simplified spawn shape.
- Forks now get a `createdBy` field on `forkSubtree` calls; update the
  route test expectation accordingly.
- #4516 removed the per-entity `error` stream; drop it from the fork
  rollback test's deleted-streams expectation.
- Add the missing `doFork` mock to two `createHandlerContext` test
  configs in context-factory.test.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants