Skip to content

feat(talon): DEEPAGENTS_TALON_RECURSION_LIMIT env var - #4354

Merged
John Kennedy (jkennedyvz) merged 1 commit into
mainfrom
jkennedyvz/talon/recursion-limit-env
Jun 28, 2026
Merged

feat(talon): DEEPAGENTS_TALON_RECURSION_LIMIT env var#4354
John Kennedy (jkennedyvz) merged 1 commit into
mainfrom
jkennedyvz/talon/recursion-limit-env

Conversation

@jkennedyvz

Copy link
Copy Markdown
Contributor

Exposes DEEPAGENTS_TALON_RECURSION_LIMIT so operators can tune the per-invocation graph recursion limit from the environment without changing code. When set, it overrides the caller-supplied recursion_limit; otherwise the existing default applies.

The default recursion limit bumps from 150 to 500 to match the new documented default in the env example, giving longer-running agents more headroom before hitting the limit. Explicit recursion_limit= call sites are unaffected, and the env var takes precedence over both.


Changes

  • Adds RECURSION_LIMIT_ENV_KEY and _recursion_limit_from_env to DeepAgentRuntime, resolved in the constructor so an invalid value fails fast at construction (matching the existing recursion_limit <= 0 guard).
  • Extracts the existing positive-int env parsing for DEEPAGENTS_TALON_CONTEXT_SIZE into a shared _positive_int_from_env helper so both keys share the same validation and error messaging.
  • Bumps DEFAULT_RECURSION_LIMIT from 150 to 500.
  • Adds DEEPAGENTS_TALON_RECURSION_LIMIT=500 to the Talon env example.
  • Documents the variable in the package README.

API impact

The recursion_limit constructor parameter is keyword-only and unchanged in position/name; only its default value moved from 150 to 500. The env var takes precedence, then the explicit arg, then the default. No breaking signature changes.

Tests

Unit tests cover: default when env unset, env override, env-beats-explicit-arg, and invalid-value rejection at construction. Full Talon suite passes (178 passed); the two pre-existing ty diagnostics in speech.py are unrelated to this change.

@github-actions github-actions Bot added feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC talon labels Jun 28, 2026
@jkennedyvz
John Kennedy (jkennedyvz) marked this pull request as ready for review June 28, 2026 22:17
Expose `DEEPAGENTS_TALON_RECURSION_LIMIT` so operators can tune the
per-invocation graph recursion limit without changing code. When set, it
overrides the caller-supplied `recursion_limit`; otherwise the existing
default applies.

The default recursion limit bumps from `150` to `500` to match the new
documented default in the env example, giving longer-running agents more
room before hitting the limit. This is a behavior change only for code
paths that relied on the constant default — explicit `recursion_limit=`
call sites are unaffected, and the env var takes precedence over both.

The existing positive-int env parsing for `DEEPAGENTS_TALON_CONTEXT_SIZE`
is extracted into a shared `_positive_int_from_env` helper so both keys
share the same validation and error messaging.

Covers default, env override, env-beats-explicit-arg, and invalid-value
cases with unit tests. Adds the variable to the Talon env example and
documents it in the package README.
@jkennedyvz
John Kennedy (jkennedyvz) force-pushed the jkennedyvz/talon/recursion-limit-env branch from 7c8469c to 9d56a8e Compare June 28, 2026 22:18
@jkennedyvz
John Kennedy (jkennedyvz) merged commit 82d1eac into main Jun 28, 2026
49 checks passed
@jkennedyvz
John Kennedy (jkennedyvz) deleted the jkennedyvz/talon/recursion-limit-env branch June 28, 2026 22:21
John Kennedy (jkennedyvz) pushed a commit that referenced this pull request Jun 30, 2026
> [!CAUTION]
> Merging this PR will automatically publish to **PyPI** and create a
**GitHub release**.

For the full release process, see
[`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md).

---

_Everything below this line will be the GitHub release body._

---


##
[0.0.2](deepagents-talon==0.0.1...deepagents-talon==0.0.2)
(2026-06-30)


### Features

* **talon:** `DEEPAGENTS_TALON_RECURSION_LIMIT` env var
([#4354](#4354))
([82d1eac](82d1eac))
* **talon:** add reaction approval routing
([#4345](#4345))
([3fe8c0c](3fe8c0c))
* **talon:** add Telegram channel adapter, CLI wiring, and offset
persistence
([#4097](#4097))
([7c87cec](7c87cec))
* **talon:** add tool approval env override
([#4349](#4349))
([d26481d](d26481d))
* **talon:** audit reaction approval attempts
([#4348](#4348))
([d7895c4](d7895c4))
* **talon:** ingest Telegram approval reactions
([#4346](#4346))
([437af0b](437af0b))


### Bug Fixes

* **talon:** default workspace to current directory
([#4099](#4099))
([5e337ae](5e337ae))

---

_Everything above this line will be the GitHub release body._

---

> [!NOTE]
> A **New Contributors** section is appended to the GitHub release notes
automatically at publish time (see [Release
Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline),
step 2).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Marcelo5444 pushed a commit to Marcelo5444/deepagents that referenced this pull request Jul 30, 2026
…#4354)

Exposes `DEEPAGENTS_TALON_RECURSION_LIMIT` so operators can tune the
per-invocation graph recursion limit from the environment without
changing code. When set, it overrides the caller-supplied
`recursion_limit`; otherwise the existing default applies.

The default recursion limit bumps from `150` to `500` to match the new
documented default in the env example, giving longer-running agents more
headroom before hitting the limit. Explicit `recursion_limit=` call
sites are unaffected, and the env var takes precedence over both.

---

**Changes**

- Adds `RECURSION_LIMIT_ENV_KEY` and `_recursion_limit_from_env` to
`DeepAgentRuntime`, resolved in the constructor so an invalid value
fails fast at construction (matching the existing `recursion_limit <= 0`
guard).
- Extracts the existing positive-int env parsing for
`DEEPAGENTS_TALON_CONTEXT_SIZE` into a shared `_positive_int_from_env`
helper so both keys share the same validation and error messaging.
- Bumps `DEFAULT_RECURSION_LIMIT` from `150` to `500`.
- Adds `DEEPAGENTS_TALON_RECURSION_LIMIT=500` to the Talon env example.
- Documents the variable in the package README.

**API impact**

The `recursion_limit` constructor parameter is keyword-only and
unchanged in position/name; only its default value moved from `150` to
`500`. The env var takes precedence, then the explicit arg, then the
default. No breaking signature changes.

**Tests**

Unit tests cover: default when env unset, env override,
env-beats-explicit-arg, and invalid-value rejection at construction.
Full Talon suite passes (`178 passed`); the two pre-existing `ty`
diagnostics in `speech.py` are unrelated to this change.

Co-authored-by: Deep Agent <agent@deepagents.dev>
Marcelo5444 pushed a commit to Marcelo5444/deepagents that referenced this pull request Jul 30, 2026
> [!CAUTION]
> Merging this PR will automatically publish to **PyPI** and create a
**GitHub release**.

For the full release process, see
[`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md).

---

_Everything below this line will be the GitHub release body._

---


##
[0.0.2](langchain-ai/deepagents@deepagents-talon==0.0.1...deepagents-talon==0.0.2)
(2026-06-30)


### Features

* **talon:** `DEEPAGENTS_TALON_RECURSION_LIMIT` env var
([langchain-ai#4354](langchain-ai#4354))
([82d1eac](langchain-ai@82d1eac))
* **talon:** add reaction approval routing
([langchain-ai#4345](langchain-ai#4345))
([3fe8c0c](langchain-ai@3fe8c0c))
* **talon:** add Telegram channel adapter, CLI wiring, and offset
persistence
([langchain-ai#4097](langchain-ai#4097))
([7c87cec](langchain-ai@7c87cec))
* **talon:** add tool approval env override
([langchain-ai#4349](langchain-ai#4349))
([d26481d](langchain-ai@d26481d))
* **talon:** audit reaction approval attempts
([langchain-ai#4348](langchain-ai#4348))
([d7895c4](langchain-ai@d7895c4))
* **talon:** ingest Telegram approval reactions
([langchain-ai#4346](langchain-ai#4346))
([437af0b](langchain-ai@437af0b))


### Bug Fixes

* **talon:** default workspace to current directory
([langchain-ai#4099](langchain-ai#4099))
([5e337ae](langchain-ai@5e337ae))

---

_Everything above this line will be the GitHub release body._

---

> [!NOTE]
> A **New Contributors** section is appended to the GitHub release notes
automatically at publish time (see [Release
Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline),
step 2).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC talon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant