Repository navigation
fix(agents): keep a first plot's expected_texts with its kept note - #12186
Merged
Merged
Conversation
A first plot that stopped on data_unconfirmed kept its change_request but not the texts the user asked to see, so the next .create_plot() checked the render for none of them. The texts now travel in anyplot.pending_expected_texts with the same lifecycle as the note: kept until a run ships, dropped by any binding write, new data version or library switch (one PENDING_CLEARED delta for both keys). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused lifecycle changes are consistent with the intended behavior, have targeted regression coverage, and have no unresolved findings.
0 open findings
What changed in this PR
Preserves expected plot texts alongside deferred first-plot requests, so retries still check the rendered title or number format.
Changes:
- Merges saved and current expected texts with deduplication and a five-item cap.
- Keeps and clears expected texts with the pending request.
- Adds regression coverage and lifecycle documentation.
| File | Description |
|---|---|
| tests/unit/agents/runtime/test_data_questions.py | Tests merging, clearing, and retry propagation. |
| docs/concepts/agent-network.md | Documents expected-text persistence. |
| changelog.d/agent-pending-expected-texts.md | Records the fix. |
| agents/anyplot/session_state.py | Defines pending texts and shared clearing state. |
| agents/anyplot/pipeline.py | Preserves and merges texts across retries. |
| agents/anyplot/opening.py | Clears pending texts on new data. |
| agents/anyplot/dataset_versions.py | Clears pending texts on version changes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- A run that brings its own request or texts checks only its own; kept texts fill in for a bare .create_plot() only (a withdrawn title is never a miss). The latest blocked turn decides the texts, never the oldest. - A binding write that keeps every binding of the moment the note was kept and only fills open roles keeps the note (pending_bindings), so a note held on incomplete_bindings reaches its plot. - Stored texts go through the PipelineArgs validator on read; ExpectedText refuses whitespace-only and control characters; take validates the joined arguments. - settle only touches the note for a first-plot run, as take does; a change of a version only cleans corrupt stored texts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #12182 and #12183. A first plot that stops on
data_unconfirmed(orincomplete_bindings, or without a queue slot) kept itschange_requestinanyplot.pending_request, but not Block F'sexpected_texts. So the next.create_plot()drew the requested title without checking the render for it.anyplot.pending_expected_textsthat travels with the note:hold_request,take_pending_requestandsettle_pending_requesthandle both.merged_textsjoins the kept texts and a run's own: no repeats, at most five, the run's own first when the cap cuts. A stored value is read item by item, and anything that is not text within 120 characters is ignored.PENDING_CLEAREDdelta covers both keys at every place that cleared the note.Test plan
uv run ruff check . && uv run ruff format --check .uv run --extra typecheck --extra agents mypy api core agents --prettyuv run --extra agents --extra test pytest tests/unit tests/integration(11,046 passed)tests/unit/agents/runtime/test_data_questions.py:merged_textscases (cap, invalid stored values).create_plot()and is cleared after the ship🤖 Generated with Claude Code
https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M