Skip to content

Composition SDK - #94

Open
Gawor270 wants to merge 7 commits into
mainfrom
fce-3730
Open

Composition SDK#94
Gawor270 wants to merge 7 commits into
mainfrom
fce-3730

Conversation

@Gawor270

@Gawor270 Gawor270 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

Adds composition support to the SDK.

  • adds the generated Composition API client
  • adds CompositionClient, covering the composition control plane
  • adds forward_room_tracks to FishjamClient, pointing a room's tracks at a composition
  • reports the linked composition back on Room
  • adds the livestream WHIP and WHEP addresses
  • adds an example composing a movie and a WHIP camera into a livestream
  • names both generated clients after the API they wrap

Motivation and Context

The Composition API had no server-side client, so anyone creating a composition
hand-rolled HTTP.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

Generated from the Composition API spec, the same way as the Fishjam client.
The whip and whep endpoints speak application/sdp, which the generator does not
support, so they are absent.
Wraps the generated bindings the way FishjamClient wraps its own, with a
register method per input and output variant because the response differs per
type. Models are exported from fishjam.composition.
Points Fishjam at a composition and reports the link back on the room. The
livestream WHIP and WHEP addresses come with it, since they are derived from
the Fishjam URL rather than configured.
A backend that composes a looping movie and a camera published over WHIP into
a Fishjam livestream, serving the credentials for both ends over HTTP.
Neither _openapi_client nor _composition_client said what the other did.
@linear

linear Bot commented Aug 27, 2026

Copy link
Copy Markdown

FCE-3730

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds server-side Composition API support, room track forwarding, livestream endpoints, and an end-to-end composition demo.

Changes:

  • Adds generated Composition and renamed Fishjam API clients.
  • Exposes composition lifecycle, input/output, renderer, event, and track-forwarding APIs.
  • Adds tests and a WHIP/WHEP livestream demo.

Reviewed changes

Copilot reviewed 140 out of 246 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
uv.lock Locks demo dependencies.
pyproject.toml Adds workspace, generator, lint, and typing configuration.
scripts.py Supports generating both API clients.
openapi-python-client-config.yaml Renames the Fishjam generated package.
openapi-python-client-composition-config.yaml Configures Composition client generation.
fishjam/__init__.py Exposes Composition APIs.
fishjam/utils.py Builds Composition, WHIP, and WHEP URLs.
fishjam/errors.py Adds Composition-specific error mapping.
fishjam/api/_client.py Tracks the original Fishjam identifier.
fishjam/api/_fishjam_client.py Adds forwarding, livestream URLs, and composition room state.
fishjam/api/_composition_client.py Implements the Composition control-plane client.
fishjam/composition/__init__.py Publishes Composition models and aliases.
fishjam/peer/__init__.py Updates generated-client imports.
fishjam/recording/__init__.py Updates generated-client imports.
fishjam/room/__init__.py Updates generated-client imports.
fishjam/_fishjam_openapi_client/** Renamed and regenerated Fishjam API client modules.
fishjam/_composition_openapi_client/** Generated Composition API client modules.
tests/test_composition.py Tests Composition operations and models.
tests/test_track_forwarding.py Tests forwarding and livestream URL behavior.
tests/test_room_api.py Updates generated-client imports.
tests/fixtures/font.ttf Adds upload-test fixture.
examples/room_manager/room_service.py Updates generated-client import.
examples/composition/.env.example Documents demo configuration.
examples/composition/README.md Documents the composition demo.
examples/composition/pyproject.toml Defines demo dependencies.
examples/composition/main.py Runs the demo server lifecycle.
examples/composition/composition/__init__.py Defines the demo package.
examples/composition/composition/app.py Provides streamer and viewer endpoints.
examples/composition/composition/config.py Defines demo configuration and assets.
examples/composition/composition/composition_service.py Orchestrates Composition resources.
examples/composition/composition/fishjam_service.py Manages the livestream room.
examples/composition/composition/scene.py Builds the demo scene.
Suppressed comments (2)

fishjam/api/_composition_client.py:641

  • A missing output on this endpoint is reported as CompositionNotFoundError because the default 404 mapping is used. Pass OutputNotFoundError here so keyframe requests have the same missing-output semantics as the other output operations.
    fishjam/api/_composition_client.py:225
  • Wrapping the raw response text in a list makes exceptions for undocumented statuses display messages such as ['gateway failure']. Pass the decoded string directly, consistent with HTTPError.from_response.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread examples/composition/composition/app.py Outdated
Comment thread examples/composition/composition/app.py
Comment thread fishjam/api/_composition_client.py Outdated
Comment thread fishjam/api/_composition_client.py
Comment thread fishjam/api/_composition_client.py Outdated
A status outside the standard set raised ValueError from the generated client
instead of an HTTPError, and messages were wrapped in a list, so they read as
['gone'] where the Fishjam ones read as text.
Building them at import allocated a room and a composition before startup, and
leaked the room when the composition failed.
@Gawor270
Gawor270 requested a review from czerwiukk August 27, 2026 12:34
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.

2 participants