AI-60: Add summary_fn parameter to TemporalModel for dynamic activity summaries#1451
Merged
Conversation
eaf06d6 to
01c9f22
Compare
tconley1428
reviewed
Apr 15, 2026
nyghtowl
added a commit
to temporal-community/ice-cream-fleet-demo
that referenced
this pull request
Apr 15, 2026
…d migration notes - Alias DemoTemporalModel as TemporalModel in agents.py so demo code and docs show the clean upstream API name - Fix race where cancelling an in-flight order shows both DELIVERED and CANCELLED: execute_customer_change now checks order status before cancelling — if already delivered, cancel is a no-op - CLAUDE.md updated with SDK PR migration plan (temporalio/sdk-python#1451) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
nyghtowl
added a commit
to temporal-community/ice-cream-fleet-demo
that referenced
this pull request
Apr 16, 2026
#22) * TemporalModel alias for demo, fix cancel-after-deliver race, CLAUDE.md migration notes - Alias DemoTemporalModel as TemporalModel in agents.py so demo code and docs show the clean upstream API name - Fix race where cancelling an in-flight order shows both DELIVERED and CANCELLED: execute_customer_change now checks order status before cancelling — if already delivered, cancel is a no-op - CLAUDE.md updated with SDK PR migration plan (temporalio/sdk-python#1451) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Ziggy's narrative, smart ETA pre-filter, order batching, new screenshot Narrative: - README intro reframed as Ziggy's delivery system, not abstract demo - Demo flow uses incident language ("Agent Goes Down", "Driver Loses Connection", "Customer Changes Mind") - DEMO_GUIDE one-minute pitch: "Ziggy's built on Temporal because ice cream delivery can't afford lost state" - Opening scenario: "Ziggy's Opens for Business" - New screenshot (meltdown-new-look.png) Fleet Agent ETA optimization: - Fleet status now includes driver positions + capacity in summary - Fleet Agent instruction: pre-filter to 1-3 closest drivers by coordinates, then call tool_get_route_info for only those - Each Maps API call remains a separate Temporal activity (per-call durability preserved for demo story) - Removed unused batch ETA code (tool_get_all_driver_etas) Order batching: - 4-second collection window after first order lets drivers accumulate 2-3 orders before starting pickup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
xumaple
commented
Apr 17, 2026
This was
linked to
issues
Apr 17, 2026
a1fdd16 to
5faef5f
Compare
…maries Introduce AdkActivityConfig extending ActivityConfig with a summary_fn field that accepts a callable for dynamic per-call summaries. When no summary_fn or static summary is set, falls back to reading adk_agent_name from LlmRequest labels for zero-config agent name display. Setting both summary and summary_fn raises ValueError to prevent ambiguity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…est, label fallback test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop AdkActivityConfig in favor of a keyword-only summary_fn parameter on TemporalModel. Zero type: ignore comments needed. Auditor findings addressed: - Label fallback test rewritten as integration test - Exception propagation documented in summary_fn docstring - Empty string summary test added Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nd docstring Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5faef5f to
f96fab4
Compare
Run all 4 summary_fn variants (dynamic, None, empty, label fallback) as sequential agent invocations within one workflow, reducing CI overhead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
brianstrauch
approved these changes
Apr 21, 2026
tconley1428
approved these changes
Apr 22, 2026
nyghtowl
added a commit
to temporal-community/ice-cream-fleet-demo
that referenced
this pull request
May 14, 2026
* Drop DemoTemporalModel shim, rename CLAUDE.md → AGENTS.md - Replace DemoTemporalModel with upstream TemporalModel + AdkActivityConfig(summary_fn=_build_summary) now that temporalio/sdk-python#1451 has shipped (temporalio 1.24.0). - Delete the DemoTemporalModel class and _strip_nulls (cosmetic) from _demo_model.py; keep _build_summary and helpers. - Rename CLAUDE.md → AGENTS.md (cross-tool convention); keep CLAUDE.md as a symlink so anything still reading the old path keeps working. - Light edit: top-of-file note about the symlink and audience. * Inline _build_summary into agents.py, drop _demo_model.py The summary builder had one caller (the three agent factories below it) and no reuse potential outside this file, so a separate module was over-fitting. Folded the constants, helpers, and _build_summary into agents.py as a new section between the activity-tool wrappers and the agent factories. Updates the prose references in AGENTS.md and README.md.
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
summary_fnkeyword-only parameter toTemporalModelfor dynamic per-call activity summariessummary_fnreceives theLlmRequestand returns a summary string (orNone)summary_fnnor staticsummaryis set, falls back to readingadk_agent_namefromLlmRequest.config.labelsfor zero-config agent name displaysummary(inActivityConfig) andsummary_fnraisesValueErrorTest plan
test_summary_fn_produces_dynamic_summary— integration test verifying dynamic summary in workflow historytest_summary_fn_returning_none— summary_fn returning None produces no summarytest_summary_fn_empty_string— empty string is a valid summarytest_adk_agent_name_label_fallback— integration test verifying zero-config label fallbacktest_summary_and_summary_fn_raises— ValueError when both summary and summary_fn set🤖 Generated with Claude Code