Repository navigation
Python: chore(core): remove unused URI_PATTERN and correct add_chain cycle docstring - #10105
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoNov 6, 2026
Conversation
…cstring Remove the URI_PATTERN regex in agent_framework/_types.py. It is not referenced anywhere in the core package (confirmed by a repo-wide grep; the a2a and purview packages define their own, separate patterns), so it is dead code. Correct the add_chain docstring in _workflows/_workflow_builder.py. The docstring stated that an executor cannot appear more than once and that cycles are not allowed, but the method simply adds an edge between each consecutive pair, and the workflow graph supports cycles. Repeating an executor (e.g. add_chain([a, b, a])) builds without error, just as add_edge(a, b).add_edge(b, a) does. This only updates the doc text to describe the existing behavior; no runtime behavior is changed.
PratikDhanave (PratikDhanave)
temporarily deployed
to
github-app-auth
November 4, 2026 16:56 — with
GitHub Actions
Inactive
PratikDhanave (PratikDhanave)
temporarily deployed
to
github-app-auth
November 4, 2026 16:56 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the unused-constant removal and workflow documentation update.
No open issues 🎉
What changed in this PR
This PR cleans up the core Python package by removing an unused constant and correcting documentation, without changing runtime behavior.
Changes:
- Remove the unused
URI_PATTERNregex while retaining the still-usedreimport. - Clarify that
add_chainpermits repeated executors and can create cycles, consistent with existing workflow behavior.
| File | Description |
|---|---|
python/packages/core/agent_framework/_workflows/_workflow_builder.py |
Correct the add_chain docstring to describe existing cycle support. |
python/packages/core/agent_framework/_types.py |
Remove the unused URI_PATTERN constant. |
Review effort: Balanced
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Nov 5, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 5, 2026
This branch was previously deployed
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.
Motivation & Context
Two small, self-contained cleanup/documentation improvements in the core Python package. This is not a bug fix: no prior behavior was broken or incorrect, and this PR changes no runtime behavior.
agent_framework/_types.pydefines a module-levelURI_PATTERNregex that is not referenced anywhere in the core package. A repo-wide grep confirms the only otherURI_PATTERN/_DATA_URI_PATTERNdefinitions live in the separatea2aandpurviewpackages and are unrelated. It is dead code, so this removes it.add_chaindocstring in_workflows/_workflow_builder.pystated that "cycles in the chain are not allowed, meaning an executor cannot appear more than once in the chain." That is not what the method does — it simply adds an edge between each consecutive pair, and the workflow graph intentionally supports cycles.add_chain([a, b, a])builds without error today, exactly asadd_edge(a, b).add_edge(b, a)does. This corrects the docstring to describe the actual, intended behavior. No runtime enforcement is added.Description & Review Guide
URI_PATTERNregex fromagent_framework/_types.py(dead-code removal). Thereimport is still used elsewhere in the file and is kept.add_chaindocstring in_workflows/_workflow_builder.pyso it accurately describes that repeated executors are permitted and can form a cycle, consistent with the rest of the framework. Documentation-only change.Verification performed locally against the core package:
uv run poe syntax -P core— passed (Ruff format + check).uv run poe test -P core— 9274 passed, 20 skipped, 2 xfailed.add_edge(a, b).add_edge(b, a)andadd_chain([a, b, a])both build without error.Related Issue
N/A - trivial change. This is a dead-code removal plus a documentation correction with no runtime impact; it is not tied to an open issue.
Fixes #
AI Assistance
AI assistance details: The code edits and this PR description were drafted with AI assistance. The changes are limited to removing one unused regex constant and correcting one docstring. The author will review and verify before merge and select the appropriate attestation above.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.