Skip to content

fix(v1): reconcile concurrent graph commits - #2477

Merged
hallerite merged 3 commits into
mainfrom
codex/fix-concurrent-graph-commits
Aug 31, 2026
Merged

fix(v1): reconcile concurrent graph commits#2477
hallerite merged 3 commits into
mainfrom
codex/fix-concurrent-graph-commits

Conversation

@hallerite

@hallerite hallerite commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • reconcile prompt nodes against the current graph when a model call commits, closing the race between concurrent prepare_turn and commit operations
  • preserve exact token-span identity for training graphs while sharing content-identical tokenless prefixes in eval graphs
  • retain hidden physical token variants instead of allowing index collisions to make them unreachable
  • correctly reuse unspanned prompt nodes without consuming tokens attributed to the next message

This is a generic main graph fix. The ACP semantic-edge work remains separate in #2449.

Reproduction

With two concurrent nano-RLM children, both first requests prepared before either committed. The second commit created a duplicate system root and overwrote the lookup entry; the first child later re-rooted through the second root, leaving an orphan leaf.

Before the fix:

  • 2 child calls
  • 4 physical branches instead of 2 + 1
  • 3 roots
  • 1 duplicate (parent, message_hash) identity

Before-fix live trace

Post-fix stress run

DeepSeek continued spawning children until the 30-minute rollout timeout, producing a stronger concurrency test:

  • 328 model calls and 658 message nodes
  • 15 child-session user roots under one shared child system node
  • exactly 15 child leaves plus 1 top-level leaf = 16 physical branches
  • 2 roots total: the top-level system and the shared child system
  • 0 duplicate (parent, message_hash) identities

The timeout made final ACP metrics unavailable, but the interception trace was sealed and retained the complete physical graph.

Post-fix live trace

Validation

  • uv run pytest -q tests/v1/test_graph.py: 10 passed
  • full tests/ suite passed before the final boundary-only regression; credential-gated cases skipped
  • Ruff, formatting, Ty, commit hooks, and push hooks pass
  • CI is green on Python 3.11, 3.12, and 3.13, including the live V1 E2E

Comment thread verifiers/v1/graph.py
@macroscopeapp

macroscopeapp Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This core v1 graph fix changes production node reuse and branch topology for concurrent evaluation and training requests, including token attribution and leaf identities. The reconciliation logic is nontrivial shared infrastructure rather than a small isolated correction.

You can add or adjust custom eligibility rules. Learn more.

@hallerite
hallerite merged commit e2103d6 into main Aug 31, 2026
13 checks passed
@hallerite
hallerite deleted the codex/fix-concurrent-graph-commits branch August 31, 2026 18:49
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