Skip to content

fix(agents): live round 9 (kept title request, localized to_long names, visible repair round, kept definition) - #12207

Merged
MarkusNeusinger merged 4 commits into
mainfrom
fix/agent-live-round-9
Oct 16, 2026
Merged

MarkusNeusinger merged 4 commits into
mainfrom
fix/agent-live-round-9

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

Live round 9 findings (2026-10-16) for the admin-only "Use with my data" chat, the Gemini review items of #12206, and the owner's telemetry rule for kept.

  • Title asked for before .confirm() was lost (bar-grouped, filialen_qx7). The root said it had noted the title, but nothing kept it: the bare .create_plot() runs plot_pipeline without arguments. root.md now tells the root to call plot_pipeline with the request on unconfirmed data too (it answers not_ready and keep_pending_request keeps it), and the result carries a root-only request_kept: true, the only basis on which the root may say a request is kept. Regression test: text turn on unconfirmed data → confirm → .create_plot() → the adapter input carries the title and its expected text.
  • .to_long() names in the session language. shape.LONG_NAMES per language (en, de, fr, es, it, pt, nl, pl; English fallback). The paste, undo, to_long, profile tool, the language route (PUT /language now answers suggestion) and every turn's done (suggestion, BFF allowlist extended) compute the offer in the current session language, and the page refreshes the card (suggestion_sync), so the card always names what the route applies. The user's own headers are never translated; collision handling is unchanged.
  • Repair round visible. Round.defects (closed rubric ids such as VQ-05) on every round and on the repairing status. The grid names rounds first try, second try, and so on, and a running repair round shows repairing text size, layout. The result card says second try, or first try shipped of 2 when an earlier round won. Note: the r9 probe's regex matched only first try|second try|try \d, and the old label was repair 1, so part of the "invisible" finding was the label itself.
  • Review fixes of fix(agents): live round 8 (short columns, color-scale hints, to_long names) #12206 (each verified):
    • judged_view judges at most 5 full values per display copy and 8,000 characters per column. The most frequent value of each copy is always judged.
    • Weekday sets are per language, and the headers must all come from one set. Portuguese (with -feira) and Dutch are complete. Headers of two letters or fewer need 5 distinct days, so FR, SA, SO and MO, MI, MA stay Category.
    • _coupling keeps every flagged part of a line, joined. A part inside another flagged part counts once (the Normalize(...) call and its keywords).
    • center is flagged only on seaborn heatmap and clustermap, and levels only on contour calls. str.center(10) was never flagged (positional argument); a test pins that.
    • .to_long() with pinned bindings carries the user's bindings on the kept columns.
  • Telemetry kept (owner rule). A session is kept when the user copied or downloaded a result after the session's last run and sent no thumbs_down or bug feedback. saved_session is never a keep. The view gets the new states rejected and saved and the new columns saves, rejections and kept. The header of 03_sessions.sql has an example table. In 04_usage_failures.sql, sessions_kept uses the view's kept. The /debug card query uses the same rule and returns kept_sessions/shipped_sessions and repaired_runs/runs, and the card shows "5 of 12" under both rates.

Decisions taken (documented in code):

  • The localized weekday word is short where the full phrase is long: Jour, Día, Giorno.
  • request_kept is root-only. It is not part of stream.PLOT_FIELDS.
  • The judge cap trades completeness for bounded cost. Rare variants beyond 5 per copy go unjudged; the model only ever reads the display copies.

Plan

N/A

Test plan

  • uv run pytest tests/unit -n auto: 12,121 passed
  • ruff check and format, mypy (api core agents)
  • app: lint, prettier, type-check, vitest (1,161 tests), build
  • Browser check against the BFF mock (desktop light, 375 px dark): the timeline shows second try … repairing text size, layout, and the card header shows second try. The offer card's language refresh is covered by a hook test, because the mock's specs have no .to_long() offer.
  • Prep eval (Haiku, eu) for the root.md change: the result follows as a comment
  • Not verifiable here: the BigQuery views, which have no SQL test harness. The coordinator re-runs 03_sessions.sql and 04_usage_failures.sql after the merge.

…s, visible repair round, kept definition)

- A plot request typed before .confirm() is kept through plot_pipeline (not_ready + request_kept) and reaches
  the adapter on the next .create_plot(); root.md says to call it and to claim "kept" only on request_kept.
- .to_long() names its new columns in the session language (LONG_NAMES table, English fallback); the
  language route and every done return the recomputed offer and the page refreshes its card.
- Round.defects (rubric ids) on rounds and the repairing status; the grid names rounds first/second try and
  shows "repairing <words>"; the result card says which round shipped when an earlier one won.
- Review fixes of #12206: judged_view cap, one-language weekday sets, all snippets per line, center/levels
  restricted to colour-mapping calls, .to_long() keeps the user's bindings on kept columns.
- Telemetry: kept = copy/download after the last run and no thumbs_down/bug; saved_session is no keep
  (states rejected, saved); the /debug card shows the counts behind both rates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:31
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agents/anyplot/tools/session.py 76.47% 4 Missing ⚠️
agents/anyplot/schemas.py 88.23% 2 Missing ⚠️
app/src/hooks/useAgentSession.ts 90.90% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The judge can exceed its character budget, and windowed telemetry can incorrectly count rejected sessions as kept.

2 open findings
What changed in this PR

This PR improves the admin agent chat’s request retention, localized data reshaping, repair progress, and usage reporting.

Changes:

  • Preserves pre-confirmation plot requests and synchronizes localized .to_long() offers.
  • Displays repair details and refines data judging, bindings, and readiness hints.
  • Revises kept-session telemetry and shows the counts behind usage rates.
File Description
tests/​unit/​api/​test_agent_usage.py Tests usage counts and keep rules.
tests/​unit/​agents/​runtime/​test_stream.py Tests suggestion events and payload limits.
tests/​unit/​agents/​runtime/​test_service_flow.py Covers retained requests, localization, and repairs.
tests/​unit/​agents/​runtime/​test_dataset_versions.py Tests preserved user bindings.
tests/​unit/​agents/​runtime/​test_dataset_judge.py Tests capped value variants.
tests/​unit/​agents/​data/​test_shape.py Tests localized names and weekday recognition.
tests/​unit/​agents/​code/​test_readiness.py Tests color-scale hints and deduplication.
docs/​reference/​api.md Documents updated response fields.
docs/​reference/​agent-telemetry.md Defines revised session classifications.
docs/​concepts/​agent-network.md Updates chat behavior documentation.
changelog.d/​agent-live-round-9.md Records fixes and behavior changes.
app/​src/​sections/​debug/​AgentUsageSection.tsx Displays usage-rate counts.
app/​src/​sections/​agent-chat/​timeline.ts Formats repair details and round labels.
app/​src/​sections/​agent-chat/​RoundGrid.tsx Displays ongoing repair descriptions.
app/​src/​sections/​agent-chat/​ResultCard.tsx Identifies the shipped round.
app/​src/​sections/​agent-chat/​ResultCard.test.tsx Updates round-label expectations.
app/​src/​sections/​agent-chat/​ProgressTimeline.test.tsx Tests repair descriptions and shipped-round labels.
app/​src/​pages/​DebugPage.test.tsx Tests usage-rate count display.
app/​src/​lib/​agent.ts Parses suggestions and defect identifiers.
app/​src/​hooks/​useAgentSession.ts Synchronizes localized offers.
app/​src/​hooks/​useAgentSession.test.ts Tests offer updates after language changes.
app/​scripts/​agent-bff-mock.mjs Mirrors new stream and language fields.
api/​routers/​agent.py Allows new event fields through the proxy.
api/​agent_usage.py Revises keep calculations and returns counts.
agents/​telemetry/​views/​04_usage_failures.sql Uses session classification for keep totals.
agents/​telemetry/​views/​03_sessions.sql Adds keep rules, rejection counts, and states.
agents/​stream.py Emits suggestions and repair identifiers.
agents/​main.py Recomputes offers in the session language.
agents/​anyplot/​tools/​session.py Localizes profile-tool offers.
agents/​anyplot/​schemas.py Adds repair identifiers and request-retention status.
agents/​anyplot/​prompts/​root.md Routes unconfirmed plot requests through persistence.
agents/​anyplot/​plugins/​tool_safety.py Omits absent retention status.
agents/​anyplot/​pipeline.py Reports retained requests and repair defects.
agents/​anyplot/​opening.py Limits judged value variants.
agents/​anyplot/​dataset_versions.py Carries user bindings alongside pinned roles.
agents/​anyplot/​data/​shape.py Localizes generated names and refines weekday detection.
agents/​anyplot/​code/​readiness.py Combines hints and narrows color-scale detection.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread agents/anyplot/opening.py Outdated
Comment thread api/agent_usage.py Outdated
@MarkusNeusinger

Copy link
Copy Markdown
Owner Author

Prep eval for the root.md change (Claude Haiku 5.5, Vertex eu, 51 cases): 48 matched, exact 94.1 % (gate 80 %), 0 unavailable, 153 LLM calls, $0.11. PASS.

MarkusNeusinger and others added 2 commits October 16, 2026 17:39
…before the usage window

Copilot review of #12207: the first values of later display copies could go over the judge's
character budget, and a thumbs_down sent just before the card's window was not seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
… counted once, offer follows its language

Gemini review of #12207 and owner decisions:
- keep_plot_request keeps a first-plot request without a run (typed before .confirm(), or a wish
  in the pasted notes from the summary turn); root.md: only request_kept true allows a kept claim,
  in every path; .to_long() names are in the session language.
- usage.sessions_kept counts a kept session once, under its last shipped run.
- The card reads runs from the 2-day lookback for the sessions of the window.
- The page applies a done's offer only together with the language it accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
@MarkusNeusinger

Copy link
Copy Markdown
Owner Author

Prep eval after the second root.md change (keep_plot_request), head 78d04b5: Claude Haiku 5.5, Vertex eu, 51 cases, 50 matched, exact 98.0 % (gate 80 %), 0 unavailable, 158 LLM calls, $0.12. PASS.

@MarkusNeusinger
MarkusNeusinger merged commit 4072d77 into main Oct 16, 2026
15 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the fix/agent-live-round-9 branch October 16, 2026 17:21
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