Skip to content

chore: release main#456

Merged
danielmillerp merged 3 commits into
mainfrom
release-please--branches--main--changes--next
Jul 1, 2026
Merged

chore: release main#456
danielmillerp merged 3 commits into
mainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app

@stainless-app stainless-app Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

✨ Stainless prepared a new release

agentex-client: 0.17.0

0.17.0 (2026-07-01)

Full Changelog: agentex-client-v0.16.2...agentex-client-v0.17.0

Features

  • temporal: opt-in continue-as-new for long-lived agent workflows (#447) (98cf744)
agentex-sdk: 0.17.0

0.17.0 (2026-07-01)

Full Changelog: agentex-sdk-v0.16.2...agentex-sdk-v0.17.0

Chores

  • agentex-sdk: Synchronize agentex versions

This pull request is managed by Stainless's GitHub App.

The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.

For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.

🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions

Greptile Summary

This release (0.17.0) introduces opt-in continue-as-new recycling for long-lived Temporal agent workflows, allowing chat/session agents to stay open indefinitely without hitting Temporal's ~50k-event/50MB history limit. The execution timeout default is also changed from 24h to None to support these indefinitely-running workflows.

  • BaseWorkflow gains four lifecycle helpers (should_continue_as_new, drain_and_continue_as_new, run_until_complete, is_continued_run) that implement the full recycle loop: waiting for Temporal's suggestion, draining in-flight signal handlers before crossing the boundary, and guarding one-time prologue work on recycled runs.
  • WORKFLOW_EXECUTION_TIMEOUT_SECONDS default changed from 86400 (24h) to None; the temporal_task_service and temporal_client are updated to pass None through to Temporal as no execution timeout.
  • Example and tests updated: the 000_hello_acp tutorial is updated to use run_until_complete as the canonical adoption pattern, and new unit tests cover should_continue_as_new / is_continued_run by faking workflow.info().

Confidence Score: 5/5

Safe to merge; the continue-as-new recycling logic is correctly implemented and the opt-in design means existing agents are unaffected until they adopt run_until_complete.

The core recycle loop correctly sequences wait_condition, handler drain, and continue_as_new; the completion-during-drain edge case is explicitly handled. The execution timeout default change and the per-run timeout semantics were already reviewed in prior comment threads. No new defects were found in this pass.

No files require special attention beyond what was already discussed in prior review threads.

Important Files Changed

Filename Overview
src/agentex/lib/core/temporal/workflows/workflow.py Core feature: adds four continue-as-new lifecycle helpers (should_continue_as_new, drain_and_continue_as_new, run_until_complete, is_continued_run) to BaseWorkflow as opt-in recycling; logic is sound and well-documented.
src/agentex/lib/core/temporal/services/temporal_task_service.py Correctly computes execution_timeout from WORKFLOW_EXECUTION_TIMEOUT_SECONDS, treating None/0/negative as no timeout before passing to start_workflow.
src/agentex/lib/core/clients/temporal/temporal_client.py execution_timeout parameter widened to timedelta
src/agentex/lib/environment_variables.py WORKFLOW_EXECUTION_TIMEOUT_SECONDS default changed from 86400 to None to support indefinite long-lived workflows; removes the implicit 24h upper bound for existing deployments not setting this env var.
examples/tutorials/10_async/10_temporal/000_hello_acp/project/workflow.py Updated example to guard welcome message with is_continued_run() and swap bare wait_condition for run_until_complete; well-commented migration guide for users.
tests/lib/core/temporal/test_base_workflow_continue_as_new.py New unit tests cover should_continue_as_new and is_continued_run by faking workflow.info(); monkeypatches the module-level workflow object correctly.
examples/tutorials/10_async/10_temporal/010_agent_chat/tests/test_agent.py Refactors streaming-event test to deduplicate message-handling code; also fixes a pre-existing bug where a bare break inside the "done" branch would exit the stream loop on the first done event regardless of content.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant C as Client
    participant W as BaseWorkflow
    participant T as Temporal Server

    C->>T: start_workflow(CreateTaskParams)
    T->>W: on_task_create(params) - original run
    W->>W: is_continued_run false, emit welcome
    W->>W: run_until_complete(params)

    loop wait_condition
        W->>W: wait for is_complete OR should_continue_as_new
        T->>W: on_task_event_send(signal)
        W-->>T: activity result
    end

    alt Temporal suggests continue-as-new
        W->>W: drain_and_continue_as_new(params)
        W->>W: wait all_handlers_finished
        W->>T: workflow.continue_as_new(params)
        T->>W: on_task_create(params) - recycled run
        W->>W: is_continued_run true, skip welcome
        W->>W: run_until_complete(params)
    else is_complete becomes true
        W-->>C: workflow completes normally
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant C as Client
    participant W as BaseWorkflow
    participant T as Temporal Server

    C->>T: start_workflow(CreateTaskParams)
    T->>W: on_task_create(params) - original run
    W->>W: is_continued_run false, emit welcome
    W->>W: run_until_complete(params)

    loop wait_condition
        W->>W: wait for is_complete OR should_continue_as_new
        T->>W: on_task_event_send(signal)
        W-->>T: activity result
    end

    alt Temporal suggests continue-as-new
        W->>W: drain_and_continue_as_new(params)
        W->>W: wait all_handlers_finished
        W->>T: workflow.continue_as_new(params)
        T->>W: on_task_create(params) - recycled run
        W->>W: is_continued_run true, skip welcome
        W->>W: run_until_complete(params)
    else is_complete becomes true
        W-->>C: workflow completes normally
    end
Loading

Reviews (2): Last reviewed commit: "chore: release main" | Re-trigger Greptile

…#447)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/agentex/lib/environment_variables.py
Comment thread src/agentex/lib/core/temporal/workflows/workflow.py
max-parke-scale and others added 2 commits June 30, 2026 20:05
…l event (#453)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@stainless-app stainless-app Bot force-pushed the release-please--branches--main--changes--next branch from 4f3a81a to 05514b6 Compare July 1, 2026 00:06
@danielmillerp danielmillerp self-requested a review July 1, 2026 08:44
@danielmillerp danielmillerp merged commit 65abf78 into main Jul 1, 2026
56 checks passed
@danielmillerp danielmillerp deleted the release-please--branches--main--changes--next branch July 1, 2026 08:44
@stainless-app

stainless-app Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@stainless-app

stainless-app Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants