Skip to content

chore(core): remove dead streaming types and LMRequestPatch from core types - #122

Open
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-core-remove-dead-streaming-types-and-lmreque-dbe705
Open

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-core-remove-dead-streaming-types-and-lmreque-dbe705

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 9, 2026

Copy link
Copy Markdown

📝 Changes Description

This MR/PR contains the following changes:
Removes ~390 lines of dead code from dspy/core/types.py and its tests: the
never-wired-up streaming subsystem (LMDelta/LM*Delta, LMStreamEvent
variants, LMOutputBuilder, LMStream, AsyncLMStream, plus the
streaming-only helpers _finalize_stream_part and _parse_json_object_strict)
and the unused LMRequestPatch dataclass together with its sole helper
_merge_lm_config. Now-unused imports (AsyncIterator, Callable,
dataclass, dataclass_field) and the corresponding dead tests in
tests/core/test_types.py are also removed.

Context

None of these symbols were in __all__ or re-exported via dspy/__init__.py,
and none had any production call-site. The streaming types were a parallel
design that was never connected to the actual streaming feature, which lives
in dspy/streaming/ (built on litellm's ModelResponseStream + StreamListener).
LMRequestPatch and _merge_lm_config were only exercised by tests; the
remaining _parse_json_object helper is kept since it has an independent
production caller in _tool_call_from_openai. No runtime behavior, outputs,
or public API surface change.

✅ Contributor Checklist

  • Pre-Commit checks are passing (locally and remotely)
  • Title of your PR / MR corresponds to the required format
  • Commit message follows required format {label}(dspy): {message}

⚠️ Warnings

None. ruff check passes; tests/core/test_types.py, tests/clients/test_lm.py,
tests/adapters/test_tool.py, and tests/predict/test_rlm.py all pass.

History


Dead Code PRs can be configured here.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown

Greptile Summary

Removes an unused request-patch abstraction and an unconnected streaming type hierarchy from core types.

  • Deletes LMRequestPatch, its configuration merge helper, and unused imports.
  • Deletes the unused stream events, deltas, builders, wrappers, and parsing helpers.
  • Removes tests that exclusively covered the deleted implementations while retaining coverage for surviving configuration behavior.

Confidence Score: 5/5

The PR appears safe to merge because the deleted symbols are unreferenced, not publicly exported, and disconnected from the active streaming implementation.

No actionable failures remain: all removed implementations were dead code, their deleted tests covered only those implementations, and surviving behavior retains relevant test coverage.

Important Files Changed

Filename Overview
dspy/core/types.py Removes unreferenced request-patch and streaming abstractions without affecting surviving callers or exports.
tests/core/test_types.py Removes tests specific to deleted code while preserving coverage of the surviving extension-flattening path.

Reviews (1): Last reviewed commit: "chore(core): remove dead streaming types..." | Re-trigger Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant