Test the data your agent hands off.

Freeze a tool result. Finish a SQL fetch. Save the right call’s row. Keep each flow’s budget.

Four native Python labs turn these hand-offs into concrete acceptance checks. Each uses local fixtures and the real SDK, with zero live model-provider calls.

Recorded fixture output / OpenAI Agents
Two calls. B finishes first.
call_idquantityunit_pricetotal
call_invoice_B3721
call_invoice_A22550

Each saved row keeps its own input and call ID. Read the native record.

Start with the record you rely on.

Freeze the tool’s JSON result.

A tool returns a dictionary containing invoice-42. A later tool appends invoice-43 to the application’s shared list. In the recorded Pydantic AI 2.68.0 stock run, the first tool’s earlier history acquires both IDs. All agents still finish with done.

For this ordinary JSON return, give the tool its own snapshot:

from copy import deepcopy

@agent.tool_plain
def read_orders() -> dict[str, list[str]]:
    return deepcopy(state)

The lab checks the first result afresh in both subsequent FunctionModel requests, then independently decodes all_messages_json() after completion.

Actual first tool result
Return methodNext two model readsSaved history
Shared dictionary42 → 42, 4342, 43
Fresh tool snapshot42 → 4242

42 and 43 abbreviate the fixture’s invoice-42 and invoice-43 IDs.

Measured scope: a JSON mapping with a nested list and two sequential tools. The application state reaches both IDs in every run. The separate helper-interception control lives in the lab; the snippet above uses the ordinary tool API.

Original report: DouweM, Pydantic AI #13412. The lab’s synthetic orders and snapshot controls are our own.

Give each flow its own budget.

Marketing and Engineering each start with 100 USD. Marketing buys eight notebooks at 5 USD each. Engineering then buys two. In CrewAI 1.15.39, two Flows built from the same nested settings share the expense list: Engineering inherits Marketing’s 40 USD charge and reports 50 USD remaining.

Give each constructor its own snapshot of the plain-data settings:

from copy import deepcopy

settings = {"wallet": {"expenses": []}}
marketing = DepartmentOrder(initial_state=deepcopy(settings))
engineering = DepartmentOrder(initial_state=deepcopy(settings))

A top-level dict(settings) keeps references to the wallet and its nested expense list. The lab runs three complete Flow → Agent → tool → final-answer paths. The tool records the purchase and calculates the budget; a controlled BaseLLM fixture requests the tool and reads its actual observation before completing.

After both purchasing flows complete
Settings per constructorCaller’s expensesEngineering’s expensesEngineering’s answer
Shared settings[40, 10][40, 10]50 USD
Top-level dict copy[40, 10][40, 10]50 USD
Fresh deepcopy[][10]90 USD

The successful control also keeps Marketing’s final expenses at [40]. Engineering’s list is checked after Marketing completes and before Engineering runs, while the original settings remain unchanged.

Measured scope: CrewAI 1.15.39, Python 3.12.3 on Linux, two separate Flow instances, plain dictionaries/lists and integer-dollar fixtures. Real Flow, Agent and tool execution; one synchronous purchase per department; zero live model-provider calls.

Original report: master1018, CrewAI #9383. Existing source proposals: YingzuoLiu #9384 and swjtuhuangjunfu #9433. This application lab supplies a caller-side change for the published SDK.

Finish fetching before reporting the SQL result.

execute() returns successfully. The first row is real. Fetching the remaining rows then raises sqlite3.OperationalError. In Agno 3.2.0, the public SQL tool returns the string "[]" for this failure.

The existing fix by adityav1709 in PR #11680 lets fetch exceptions reach the outer run_sql_query error handler. This excerpt from its run_sql keeps successful transaction completion and row collection together:

with self.Session() as sess, sess.begin():
    result = sess.execute(text(sql))

    if not result.returns_rows:  # type: ignore[attr-defined]
        return []

    if limit is None:
        rows = result.fetchall()
    elif limit > 0:
        rows = result.fetchmany(limit)
    else:
        rows = []
    return [row._asdict() for row in rows]

The outer handler reports Error running query: …. A legitimate empty SELECT still returns "[]"; non-returning CREATE and INSERT complete normally. An independent DBAPI connection confirms the inserted value 7.

Use a failure that happens during fetching. This lab’s SQLite UDF raises on the third row: execute → first row → fetch error. SQLAlchemy result methods stay unchanged. Both unlimited and limit-2 tool queries hit the real error.

Measured scope: file-backed SQLite, SQLAlchemy 2.0.57, published Agno 3.2.0 and two frozen SQL modules. The package compares the pinned 3.2.0/frozen-main sources with the existing PR’s module; that patch was closed and unmerged at discovery. PR #11680 was merged upstream on 2026-11-17; these recorded results retain their original source pins. Production drivers and their error contracts get their own tests.

Original report: JiaxPeaceLove, Agno #11557. Existing SQL fix: adityav1709, with disclosed Muse (Aurora) co-authorship. Source and lab retain Apache-2.0 attribution.

Save from the result of this call.

A purchasing agent receives the correct total 50, while its original end-hook CSV row has empty quantity and unit-price columns. In OpenAI Agents 0.24.0, the nested result still carries the structured purchase and its call ID.

Save in the public custom_output_extractor. The lab’s callback validates this call’s input, appends its complete row, then returns the original output to the parent:

async def extract(result):
    purchase = Purchase.model_validate(result.context_wrapper.tool_input)
    invocation = result.agent_tool_invocation
    assert invocation is not None
    call_id = invocation.tool_call_id
    assert result.final_output == expected_outputs[call_id]
    row = [call_id, purchase.quantity, purchase.unit_price, result.final_output]
    observed.append(row)
    if save_with_extractor:
        append_row(row)
    return result.final_output

Excerpt from the complete fixture app: expected_outputs is its acceptance oracle and save_with_extractor selects the recorded control. Register with calculator.as_tool(parameters=Purchase, custom_output_extractor=extract, …); the full lab supplies the schema, models, parent and CSV initialization. It initializes the header once and appends each complete row synchronously, without an intervening await.

Read the saved CSV back. Check the header, row count, input fields and call IDs. The two-call control makes B finish first: B / 3 / 7 / 21, then A / 2 / 25 / 50. The parent receives A: "50" and B: "21" and completes normally.

Measured scope: completed, non-streaming calls, structured integer purchases, one event loop and a local CSV. ScriptedModel derives totals from the actual nested input. Shared application context keeps its normal SDK semantics; approval/resume and distributed write recovery use separate contracts.

Original report: master1018, OpenAI Agents #5935. TechAura traced the hook field; Retsumdk reported hook controls and a source-level fix. This independent application method uses the SDK’s existing public extractor.

Upstream update: seratch’s hook-input fix merged on November 16, 2026 (UTC). The merged source passes the current nested call’s parsed tool_input to agent start and end hooks in both streaming and non-streaming runs. This lab stays pinned to 0.24.0, preserving the original behavior and the public-extractor control.

Run one complete lab.

Choose your SDK’s ZIP above, extract it and use a fresh virtual environment for that lab. Each README includes its measured Python version, dependency pins and platform commands.

LabAfter installing its requirementsCompletion signal
CrewAIpython probe.py --out my-results.jsonPASS; complete purchases and three state-ownership controls asserted
Pydantic AIpython probe.py > my-result.jsonExit 0; stock change and stable copies asserted
Agno SQLpython run_lab.py --output my-results.jsonPASS; the intentional SQL error tracebacks are expected
OpenAI Agentspython probe.py --out ./resultsall_checks_passed: true; three CSVs written

The packages assert the observed faulty path and their successful controls. Their recorded results are local native executions. This guide is a static reading and download page.

Turn your own hand-off into a check.

Keep one normal case and one deliberately failing case. Capture the value at the boundary you depend on, then read the resulting history, tool string or saved file independently. For per-call writes, use two distinguishable inputs and reversed completion order.

Send your case

Send the SDK version and a small sanitized expected/actual example. A repair starts with an agreed scope, acceptance case, budget and date.