Repository navigation
Python: chore: drop four module constants nothing reads - #10395
Open
Hyacinth-of-Security (lxcxjxhx) wants to merge 2 commits into
Open
Hyacinth-of-Security (lxcxjxhx) wants to merge 2 commits into
Hyacinth-of-Security (lxcxjxhx) wants to merge 2 commits into
Conversation
Each name below appears exactly once in the repository — its own definition — and
is in no `__all__`:
* `CONVERSATION_ITEM_TYPE_CHECKPOINT` / `CONVERSATION_TYPE_CHECKPOINT_CONTAINER`
(devui). The two checkpoint items are written as the `"checkpoint"` literal at
both call sites, so the constants were left behind by a refactor.
* `BEDROCK_OPTION_TRANSLATIONS` (bedrock). The Converse request is assembled
inline (`"modelId": model`, `"inferenceConfig": {...}`); nothing consults the
mapping.
* `AGUI_OPTION_TRANSLATIONS` (ag-ui). An empty dict, unread.
* `KNOWN_MEDIA_TYPES` (core). `detect_media_type_from_base64` decides the media
type; the list is unused.
Docstrings-only change to the module namespace: no call site, no signature, no
behaviour.
Hyacinth-of-Security (lxcxjxhx)
deployed
to
github-app-auth
November 16, 2026 21:56 — with
GitHub Actions
Active
Hyacinth-of-Security (lxcxjxhx)
deployed
to
github-app-auth
November 16, 2026 21:56 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for this cleanup of unused module-level constants.
No open issues 🎉
What changed in this PR
Removes five unused module-level constants from four Python packages, continuing the dead-code cleanup established by #10239. No call sites, signatures, or defaults are changed.
Changes:
- Removes two unused DevUI checkpoint constants.
- Deletes unused Bedrock and AG-UI option-translation mappings.
- Removes the unused core media-type list.
| File | Description |
|---|---|
python/packages/devui/agent_framework_devui/_conversations.py |
Removes two checkpoint type constants. |
python/packages/core/agent_framework/_types.py |
Removes KNOWN_MEDIA_TYPES. |
python/packages/bedrock/agent_framework_bedrock/_chat_client.py |
Removes BEDROCK_OPTION_TRANSLATIONS and its docstring. |
python/packages/ag-ui/agent_framework_ag_ui/_types.py |
Removes the empty AGUI_OPTION_TRANSLATIONS mapping and its docstring. |
Review effort: Balanced
Hyacinth-of-Security (lxcxjxhx)
deployed
to
github-app-auth
November 17, 2026 01:10 — with
GitHub Actions
Active
This branch was successfully 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.
Four module-level names that no code reads. Each appears exactly once in the repository — its own definition — and none is listed in an
__all__.The four
devui/.../_conversations.pyCONVERSATION_ITEM_TYPE_CHECKPOINT,CONVERSATION_TYPE_CHECKPOINT_CONTAINER"type": "checkpoint"(lines 518, 785), so the constants were left behind when the literal replaced thembedrock/.../_chat_client.pyBEDROCK_OPTION_TRANSLATIONS"modelId": model,"inferenceConfig": {"maxTokens": …}); nothing consults the mappingag-ui/.../_types.pyAGUI_OPTION_TRANSLATIONScore/.../_types.pyKNOWN_MEDIA_TYPESdetect_media_type_from_base64decides the media type; the list is unusedWhat this is not
bedrock/.../_chat_client.pyhas an__all__and these are not in it; the other three modules have no__all__and the names are not re-exported by their packages (grepacross__init__.pyfiles returns nothing).Verification
.pyin the repo (1365 files) reports these five as "defined once, read nowhere"; the same pass after this change reports only two constants insidepython/samples/andRESPONSE_TYPEinagent_framework_openai/_shared.py, which I left alone: removing that union would orphan eight imports, so it belongs in its own change.python -m compileallon the four touched files, thenruff checkandruff format --check: clean.Precedent
#10239removedOTEL_METRICSthe same way and was merged, which is why I am proposing the leftovers in one pass rather than one PR per file.