Skip to content

Add durable shared task coordination - #2031

Closed
phytal wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
zeroset-inc:sync/external-upstream-2026-09-03
Closed

Add durable shared task coordination#2031
phytal wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
zeroset-inc:sync/external-upstream-2026-09-03

Conversation

@phytal

@phytal phytal commented Sep 4, 2026

Copy link
Copy Markdown

Summary

Ports the durable shared task-coordination runtime from the Zero fork onto current upstream main (0.9.1).

  • persists scoped task plans, attempts, handoffs, gaps, evidence, and usage in a shared task graph
  • injects predecessor handoffs into replacement agents and prevents historical claim/question overlap
  • preserves recursive child delegation while returning durable findings to ancestors
  • uses trusted inspection evidence and graph-wide token accounting for convergence
  • supports durable task-owner resume across inline and daemon-hosted runtimes
  • keeps upstream's newer child startup, deletion, settlement, and terminal-notice lifecycle intact

This is a semantic rebase rather than a commit replay: the fork diverged before upstream's recent runtime/lifecycle work, so the task coordination layer was adapted to current APIs and upstream behavior instead of bringing back obsolete lifecycle code.

Validation

  • npm run check
  • focused coding-agent suites: 263 passed
  • upstream recursion suite: 113 passed (included above)
  • full Prime Python runtime suite: 281 passed, 1 skipped
  • git diff --check

The equivalent focused fork change is zeroset-inc#23.

Note

Add durable shared task coordination for agent sessions

  • Introduces a durable task graph that lets AgentSession delegate, replace, complete, defer, and cancel supervised tasks across parent and child sessions with actor-authorized host handlers in handleAgentTaskHostRequest
  • Propagates task ownership, accounting, actor identity, and a shared turn-capacity pool into RLM child sessions; child runs reserve tasks, record usage to the graph, and run bounded completion correction on validation failure
  • Adds admitTaskResume and _dispatchTaskResume so persisted resume requests route to the owning session across active, passive (rehydrated), and nested runtimes
  • Adds Linux seccomp + Python audit-hook enforcement (enforce_inspection_only) applied during IPython kernel startup when executionProfile is inspection_only, denying process-execution and cross-process syscalls
  • Fixes context-tree usage reconciliation: computeOwnAndTotalUsage preserves parent total-token count after child attribution subtraction, and reconcileContextTreeTotalUsage includes structural descendants and disposed identified children without double-counting
  • Behavioral Change: AgentSession turn execution, continuation, and auto-refine now acquire a shared capacity lease when a pool is configured; sessions without a pool are unaffected. enforce_inspection_only raises RuntimeError on non-Linux or unsupported architectures. Invalid task_id in host payloads now raises RuntimeError in rlm._spawn_handle_from_payload and rlm._subagent_from_payload.

Macroscope summarized 4dcfcde.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Hi @phytal, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/PrimeIntellect-ai/prime-agent/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Sep 4, 2026
@phytal
phytal deleted the sync/external-upstream-2026-09-03 branch September 4, 2026 02:01
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