Skip to content

fix: move off the LLM context frames pipecat removed in 1.8 - #5

Open
Rehansanjay wants to merge 1 commit into
usemoss:mainfrom
Rehansanjay:fix/removed-context-frames
Open

Rehansanjay wants to merge 1 commit into
usemoss:mainfrom
Rehansanjay:fix/removed-context-frames

Conversation

@Rehansanjay

Copy link
Copy Markdown

MossIndexProcessor cannot be imported on any current pipecat:

ImportError: cannot import name 'LLMMessagesFrame' from 'pipecat.frames.frames'
ModuleNotFoundError: No module named 'pipecat.processors.aggregators.openai_llm_context'

pipecat-ai 1.8 removed LLMMessagesFrame, and removed OpenAILLMContext, OpenAILLMContextFrame and the whole openai_llm_context module with it (#4215). LLMContextFrame and LLMContext are the replacements, and all services use the universal LLMContext now.

The dependency allows pipecat-ai>=0.0.99 with no upper bound, so a fresh install resolves to 1.11 and the processor fails at import.

What changed

The two dead branches are removed rather than ported. Nothing can emit a frame type that no longer exists, so isinstance(frame, LLMMessagesFrame) and the OpenAILLMContextFrame arm were unreachable code that only existed to fail at import time. What remains is the LLMContextFrame path, which is what pipecat sends now.

The augmented frame is forwarded as it arrived, instead of being rebuilt. The old code pushed type(frame)(context=context). Since context is the same object the frame arrived with and the retrieval augments it in place, rebuilding was never necessary — and it dropped every other field on the frame. speculation is the one that matters: it marks an inference run from a provisional context whose response must not reach the user and whose tool calls must not execute. A speculative frame rebuilt this way arrives at the service looking like an ordinary turn.

pipecat-ai floor raised to 1.8, the first release with LLMContextFrame. The old floor cannot satisfy this code, and the old code cannot run on anything current, so the range had to move one way or the other.

Verified

On a clean environment against pipecat-ai 1.11.0: the module imports, LLMContextFrame(context=..., speculation=True) keeps its speculation through the processor, and _get_latest_user_text still finds the latest user turn from LLMContext.get_messages(). Both removed names are confirmed absent on that version, which is what makes the current import fail.

Separately — one more thing blocking the package

Unrelated to pipecat, and not fixed here because it is yours to decide: pipecat_moss/__init__.py imports AddDocumentsOptions from inferedge_moss, and the current inferedge_moss on PyPI does not export it (it has GetDocumentsOptions). So even with this PR, import pipecat_moss raises:

ImportError: cannot import name 'AddDocumentsOptions' from 'inferedge_moss'

Happy to send a second PR for that once you say which side should move — the plugin's import or the SDK's export.

Found with a checker I run nightly over every community plugin listed in the Pipecat docs, against the latest release and against main: https://github.com/Rehansanjay/pipecat-plugin-health

LLMMessagesFrame and OpenAILLMContextFrame (with the whole
openai_llm_context module) were removed in pipecat-ai 1.8; LLMContextFrame
and LLMContext replace them. The processor imported all three, so it
raised ImportError on any pipecat the dependency allowed above 1.8.

The two dead branches are gone rather than ported: nothing can emit a
frame type that no longer exists. What remains is the LLMContextFrame
path, which is what pipecat sends now.

The augmented frame is also forwarded as it arrived instead of being
rebuilt. Rebuilding dropped every field except the context, including
speculation -- a provisional inference would have reached the service
looking like a real turn.

Raises the pipecat-ai floor to 1.8, the first release with LLMContextFrame.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ed0f495b-7aaa-461a-b51a-16034085b393


Comment @coderabbitai help to get the list of available commands.

rafaelbeckel added a commit to usemoss/moss that referenced this pull request Oct 23, 2026
…ed (#562)

## Summary

`pipecat-moss` 0.0.3, the version on PyPI, cannot be imported on a fresh
install. It pins `inferedge-moss`, which no longer exports
`AddDocumentsOptions`, and it imports the `openai_llm_context` module
that `pipecat-ai` 1.8 removed. The source here already moved to `moss`
and `LLMContextFrame` but was never released. This PR adds what the docs
need to teach one service per process, and fixes a frame bug.

- **`cache_path`** on `MossRetrievalService`, passed to the
`MossClient`. A load in a new process reads an unchanged index from disk
instead of downloading it. Requires `moss` 1.14.0 or later; the lock
moves to 1.19.0.
- **`load_index` takes `auto_refresh`** and passes every call through to
`MossClient.load_index`, which loads the index or checks a loaded one
for a newer cloud version, and where the backend checks a paused or
over-credit org. The README and the demo leave `auto_refresh` off: its
periodic refresh counts as session time, so a long-running process with
it on is billed around the clock.
- **Frames are forwarded unchanged.** The processor rebuilt
`LLMContextFrame` and `LLMMessagesUpdateFrame`, dropping `speculation`
(a speculative run then reaches the LLM as a normal turn) and `run_llm`.
It now pushes the frame it received. This issue was first reported in
usemoss/pipecat-moss#5.
- **Credentials fall back to `MOSS_PROJECT_ID` and `MOSS_PROJECT_KEY`**
as the README says. Missing credentials raise `ValueError` instead of
failing inside the native client.
- The example creates one service per process and awaits `load_index` in
each bot. The README and CHANGELOG (under Unreleased) are updated.

## Notes

- Releasing needs a version above 0.0.5 or a publish of 0.0.5. Neither
is part of this PR.
- usemoss/pipecat-moss is an older copy of this package, and its open
PRs target that repo.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a href="https://cubic.dev/pr/usemoss/moss/pull/562?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/usemoss/moss/562?returnTo=https%3A%2F%2Fgithub.com%2Fusemoss%2Fmoss%2Fpull%2F562&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added persistent caching for Moss indexes with optional automatic
refresh.
* Concurrent requests for the same index now share one loading
operation.
* Added environment-variable fallbacks for Moss credentials and clearer
missing-credential errors.
* **Bug Fixes**
  * Index-loading failures now propagate correctly and can be retried.
* Preserved message context and frame properties during retrieval
processing.
* **Documentation**
* Updated setup guidance, configuration options, usage examples, and
compatibility requirements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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