Skip to content

fix(examples): read pydantic-ai run result from .output - #2908

Merged
chaliy merged 2 commits into
mainfrom
claude/project-thread-hcbtls
Nov 10, 2026
Merged

chaliy merged 2 commits into
mainfrom
claude/project-thread-hcbtls

Conversation

@chaliy

@chaliy chaliy commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Михайло · project thread

What changed

examples/pydantic_ai_bash_agent.py prints result.output instead of result.data.

Why

pydantic-ai 1.0 removed AgentRunResult.data. bashkit[pydantic-ai] requires pydantic-ai>=1.0, so the example crashed right after a successful agent run. Found during the pre-release integration pass (no CI job runs this LLM-backed example).

Before / After

Before (pydantic-ai 2.66.0, local 0.20.3+main wheel, real Anthropic key):

  File "examples/pydantic_ai_bash_agent.py", line 71, in main
    print(result.data)
AttributeError: 'AgentRunResult' object has no attribute 'data'

After: exit 0, agent summary printed (FizzBuzz script created, shown, sourced, correct 1..20 output).

Risk

  • Low
  • Example only, no library code.

Checklist

  • Tests added or updated (example run manually against live model)
  • Backward compatibility considered (extra already requires pydantic-ai>=1.0)

🤖 Generated with Claude Code

pydantic-ai 1.0 removed AgentRunResult.data; the extra pins pydantic-ai>=1.0, so the example crashed after a successful agent run.
@chaliy chaliy self-assigned this Nov 10, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 0ed3485 Commit Preview URL

Branch Preview URL
Nov 10 2026, 08:13 PM

@bashkit-pr-reviewer bashkit-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One finding only; the example fix itself looks correct.

@bashkit-pr-reviewer

bashkit-pr-reviewer Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Review summary (head 0ed3485)

Verdict: Clean one-line example fix; no findings. Safe to merge.

Findings: None on this push. The earlier P2 (unrelated-cargo-lock-churn, 52 lines of incidental stacker/psm/object additions to crates/bashkit-python/test-fixtures/random-fs/Cargo.lock) is resolved — the lockfile is no longer in the diff.

Context checked beyond the diff: full diff visible (truncated: false, now only examples/pydantic_ai_bash_agent.py line 71: result.data → result.output); confirmed against the checked-out head plus the previously read crates/bashkit-python/pyproject.toml extra (pydantic-ai>=1.0, consistent with .data being gone) and CI (examples job covers Rust examples only, so the PR's manual live-model run is the right verification for this LLM-keyed example).

Not reviewed: nothing outstanding; the single changed file was fully visible.

@chaliy
chaliy merged commit c40f603 into main Nov 10, 2026
38 checks passed
@chaliy
chaliy deleted the claude/project-thread-hcbtls branch November 10, 2026 20:44
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