Skip to content

Write a graph's input fields to state once, not again from the initial node - #43

Open
ericeil wants to merge 1 commit into
masterfrom
eric/initial-node-single-write
Open

ericeil wants to merge 1 commit into
masterfrom
eric/initial-node-single-write

Conversation

@ericeil

@ericeil ericeil commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The initial node copied every input field other than input and front_matter into its state update. The graph had already written those fields to state when it was invoked. So any field with a reducer ran that reducer twice, and an appending reducer doubled its value.

In AutoProver, a CVLR author resumed from its last draft is seeded with the edit ids it had already applied (version_history, whose reducer appends). Each id came out twice, and so did each edit in the run's report.

The node now returns only the opening messages. Input fields still reach the state, because the graph writes them on invocation.

Tests:

  • New tests/test_initial_node.py runs the real initial_node in a StateGraph. The reducer test fails before this change and passes after it.
  • graphcore: 274 tests pass.
  • AutoProver: its full suite, 3030 tests with -m "not expensive", passes against this branch.

Getting it into AutoProver: AutoProver pins graphcore at f4221b6, which is on eric/summary-nonempty. It will pick this fix up at its next re-pin.

🤖 Generated with Claude Code

…l node

The initial node copied every input field other than `input` and
`front_matter` into its update. The graph had already written them when it
was invoked, so a field with a reducer ran it twice: an appending one came
out doubled. A caller seeding an author with the edit ids it had already
applied got each id twice. The node now returns only the opening messages.

Co-Authored-By: Claude Opus 5.5 <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.

1 participant