From 5f65858789721baee9ac2466a2117b093a9d9063 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 19:19:23 +0000 Subject: [PATCH 1/4] Initial plan From 07b077124723f6d2a9ff536896cb021940e12cb3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 19:33:09 +0000 Subject: [PATCH 2/4] dx: uv CI, DeprecationWarning for legacy session_kwargs, CHANGELOG, issue templates, Makefile, .env.example Co-authored-by: mahimairaja <81288263+mahimairaja@users.noreply.github.com> Agent-Logs-Url: https://github.com/mahimairaja/openrtc-python/sessions/8a5d0a46-51e0-4cf9-8e93-c595c640b3fe --- .env.example | 42 ++++++ .github/ISSUE_TEMPLATE/bug_report.yml | 83 ++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 58 +++++++++ .github/workflows/lint.yml | 19 ++- .github/workflows/test.yml | 12 +- CHANGELOG.md | 142 +++++++++++++++++++++ Makefile | 40 ++++++ src/openrtc/pool.py | 11 ++ tests/test_pool.py | 77 +++++++++++ tests/test_routing.py | 7 +- 10 files changed, 472 insertions(+), 19 deletions(-) create mode 100644 .env.example create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 CHANGELOG.md create mode 100644 Makefile diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..bdd3cbf --- /dev/null +++ b/.env.example @@ -0,0 +1,42 @@ +# OpenRTC environment variables +# Copy this file to .env and fill in the values for your setup. +# python-dotenv is used in the examples: `from dotenv import load_dotenv; load_dotenv()` + +# --------------------------------------------------------------------------- +# LiveKit connection (required for dev / start / connect / console) +# --------------------------------------------------------------------------- +LIVEKIT_URL=ws://localhost:7880 +LIVEKIT_API_KEY=devkey +LIVEKIT_API_SECRET=secret + +# --------------------------------------------------------------------------- +# Provider API keys — set only the keys for providers your agents use +# --------------------------------------------------------------------------- + +# OpenAI (STT: gpt-4o-mini-transcribe, LLM: gpt-4.1-mini, TTS: gpt-4o-mini-tts) +OPENAI_API_KEY= + +# Deepgram (STT: deepgram/nova-3:multi) +DEEPGRAM_API_KEY= + +# Cartesia (TTS: cartesia/sonic-3) +CARTESIA_API_KEY= + +# ElevenLabs (TTS: elevenlabs/*) +ELEVEN_API_KEY= + +# Azure OpenAI (if using azure provider strings) +AZURE_OPENAI_API_KEY= +AZURE_OPENAI_ENDPOINT= + +# --------------------------------------------------------------------------- +# Optional: remote end-of-turn model (LiveKit Cloud) +# Set this to enable multilingual remote turn detection via LIVEKIT_REMOTE_EOT_URL +# --------------------------------------------------------------------------- +LIVEKIT_REMOTE_EOT_URL= + +# --------------------------------------------------------------------------- +# Logging level passed through to the LiveKit worker +# One of: DEBUG, INFO, WARNING, ERROR +# --------------------------------------------------------------------------- +LIVEKIT_LOG_LEVEL=INFO diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..04db90f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,83 @@ +name: Bug report +description: Report a reproducible bug in OpenRTC +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to report a bug. Please fill in as much detail as possible so we can reproduce and fix it quickly. + + - type: input + id: version + attributes: + label: OpenRTC version + description: Output of `python -c "import openrtc; print(openrtc.__version__)"` + placeholder: "e.g. 0.0.15" + validations: + required: true + + - type: input + id: python-version + attributes: + label: Python version + description: Output of `python --version` + placeholder: "e.g. 3.12.2" + validations: + required: true + + - type: input + id: livekit-agents-version + attributes: + label: livekit-agents version + description: Output of `python -c "import livekit.agents; print(livekit.agents.__version__)"` + placeholder: "e.g. 1.4.3" + validations: + required: false + + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce + description: Minimal steps to reproduce the issue. + placeholder: | + 1. Create a pool with `AgentPool(...)` + 2. Call `pool.add(...)` + 3. Start with `pool.run()` + 4. See error + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected behaviour + description: What did you expect to happen? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: Actual behaviour + description: What actually happened? Include the full traceback if applicable. + render: python + validations: + required: true + + - type: textarea + id: extra + attributes: + label: Additional context + description: | + Any other context, environment details, or screenshots that may help. + For example: OS, deployment environment (Docker, bare metal, cloud), provider plugins in use. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..6891b48 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,58 @@ +name: Feature request +description: Propose an improvement or new capability for OpenRTC +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for suggesting an improvement! Please describe the problem you're solving and the solution you have in mind. + + - type: textarea + id: problem + attributes: + label: Problem statement + description: | + What problem are you trying to solve? Describe the use case that is not well-served today. + placeholder: "I'm trying to do X, but OpenRTC currently doesn't support it because..." + validations: + required: true + + - type: textarea + id: proposed-solution + attributes: + label: Proposed solution + description: | + Describe the feature or change you'd like. Include example code if helpful. + placeholder: | + Add a `pool.add_async()` method that accepts an async factory so providers + can be lazily initialised on first call. + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: | + Are there workarounds you've already tried? Why aren't they sufficient? + validations: + required: false + + - type: dropdown + id: breaking + attributes: + label: Does this require a breaking API change? + options: + - "No — purely additive" + - "Yes — existing callers would need to update" + - "Not sure" + validations: + required: true + + - type: textarea + id: extra + attributes: + label: Additional context + description: Links, prior art, related issues, or any other context. + validations: + required: false diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 11b03ce..a8ce79d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,22 +11,21 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: "3.11" - - name: Install lint dependencies - run: | - python -m pip install --upgrade pip - python -m pip install ruff "mypy>=1.19.1" - python -m pip install -e ".[cli,tui]" + - name: Install dependencies + run: uv sync --group dev - name: Check formatting - run: ruff format --check . + run: uv run ruff format --check . - name: Run lint checks - run: ruff check . + run: uv run ruff check . - name: Run mypy - run: mypy src/ + run: uv run mypy src/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 370ca74..5b6d437 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,18 +18,18 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e ".[cli,tui]" pytest pytest-asyncio pytest-cov + run: uv sync --group dev - name: Run tests with coverage - run: pytest --cov=openrtc --cov-report=xml --cov-fail-under=80 + run: uv run pytest --cov=openrtc --cov-report=xml --cov-fail-under=80 - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c9c7232 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,142 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +--- + +## [Unreleased] + +### Added +- `DeprecationWarning` is now emitted when deprecated top-level `session_kwargs` + keys (e.g. `allow_interruptions`, `min_endpointing_delay`) are passed. + Migrate to the `turn_handling` dict — see `AgentPool.add()` docstring. +- GitHub issue templates for bug reports and feature requests. +- `Makefile` with shortcuts for common developer commands (`make test`, + `make lint`, `make format`, `make typecheck`). +- `.env.example` documenting all supported environment variables. + +### Changed +- CI test and lint workflows migrated from bare `pip` to `uv` with lockfile + caching, matching the `uv sync --group dev` workflow in `CONTRIBUTING.md`. + +--- + +## [0.0.15] - 2026-03-22 + +### Fixed +- CLI: generic error message in `validate_metrics_watch_path`; restored + `sys.argv` correctly when `main(argv=…)` is called programmatically. + +### Added +- CLI: positional shortcuts for `list`, `connect`, `download-files`, and `tui` + commands so the agents directory and metrics path can be passed as positional + arguments. +- CLI: positional agents dir and metrics JSONL path on `start`/`dev`/`console`. +- CLI: `openrtc tui` defaults `--watch` to `./openrtc-metrics.jsonl`. + +--- + +## [0.0.14] - 2026-03-22 + +### Changed +- Require **Python 3.11+** (dropped 3.10; transitive `onnxruntime` does not + ship supported wheels for 3.10). +- CLI refactored into focused submodules (`cli_app`, `cli_livekit`, + `cli_params`, `cli_reporter`, `cli_types`, `cli_dashboard`). +- Added `ProviderValue` type alias (`str | object`) for STT/LLM/TTS slots; + exported from the public package surface. +- `SharedLiveKitWorkerOptions` dataclass bundles worker hand-off options. +- Provider serialisation registry (`_PROVIDER_REF_KEYS`) for spawn-safe + round-trip of OpenAI plugin objects; OpenAI `NotGiven` sentinel detected + without coupling to `repr()`. + +--- + +## [0.0.13] - 2026-03-22 + +### Added +- Runtime CLI observability dashboard (`openrtc dev --dashboard`). +- Metrics JSONL stream: session lifecycle events written to a configurable + `.jsonl` file for the TUI sidecar (`--metrics-jsonl`). +- Textual sidecar TUI (`openrtc tui`); optional install with + `pip install 'openrtc[tui]'`. + +### Fixed +- Leaked runtime session counters after session errors. + +--- + +## [0.0.12] - 2026-03-21 + +### Added +- `AgentConfig.source_path` records the resolved path of the discovered module. +- Resource monitoring: `get_process_resident_set_info()` and + `SavingsEstimate`; `pool.runtime_snapshot()` includes live memory data. +- Coverage gate enforced at 80% (`--cov-fail-under=80`). + +--- + +## [0.0.11] - 2026-03-21 + +### Fixed +- `resource` module lazy-imported on Windows where `RUSAGE_SELF` is absent. + +--- + +## [0.0.9] - 2026-03-21 + +### Added +- Agent resource monitoring via `PoolRuntimeSnapshot` and + `RuntimeMetricsStore`. +- `pool.runtime_snapshot()` public method. +- `pool.drain_metrics_stream_events()` public method. + +--- + +## [0.0.8] - 2026-03-21 + +### Fixed +- `PicklingError` for agent classes discovered from non-package modules in + `dev` / spawn mode; `_AgentClassRef` now stores and resolves by file path. + +--- + +## [0.0.5] - 2026-03-21 + +### Added +- `AgentPool.discover()` for automatic one-file-per-agent discovery. +- `@agent_config(name, stt, llm, tts, greeting)` decorator for per-agent + metadata in discovered modules. +- Room-name prefix routing fallback. + +### Fixed +- Worker callbacks made spawn-safe; `AgentPool` state serialised through + `_PoolRuntimeState` for cross-process delivery. + +--- + +## [0.0.2] - 2026-03-20 + +### Added +- Initial public release. +- `AgentPool` with `add()`, `remove()`, `get()`, `list_agents()`, and `run()`. +- Job and room metadata routing (`agent` / `demo` keys). +- Shared prewarm for Silero VAD and multilingual turn detector. +- `AgentSession` wired per call with per-agent STT/LLM/TTS providers. +- Greeting support via `session.generate_reply()`. +- `openrtc[cli]` optional extra for `rich`/`typer` CLI. +- PEP 561 `py.typed` marker shipped in the wheel. + +[Unreleased]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.15...HEAD +[0.0.15]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.14...v0.0.15 +[0.0.14]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.13...v0.0.14 +[0.0.13]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.12...v0.0.13 +[0.0.12]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.11...v0.0.12 +[0.0.11]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.9...v0.0.11 +[0.0.9]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.8...v0.0.9 +[0.0.8]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.5...v0.0.8 +[0.0.5]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.2...v0.0.5 +[0.0.2]: https://github.com/mahimairaja/openrtc-python/releases/tag/v0.0.2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e05f662 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +# OpenRTC developer convenience targets. +# All commands delegate to `uv run` so they pick up the locked dev environment. +# Run `uv sync --group dev` once to set up the environment, then use these targets. + +.PHONY: help install test lint format typecheck dev clean + +help: ## Show this help message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ + | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' + +install: ## Install package and dev dependencies via uv + uv sync --group dev + +test: ## Run the test suite with coverage + uv run pytest --cov=openrtc --cov-report=term-missing --cov-fail-under=80 + +test-fast: ## Run tests without coverage (faster feedback loop) + uv run pytest -q + +lint: ## Run Ruff lint checks + uv run ruff check . + +format: ## Auto-format code with Ruff + uv run ruff format . + +format-check: ## Check formatting without making changes (used in CI) + uv run ruff format --check . + +typecheck: ## Run mypy type checks on the source tree + uv run mypy src/ + +dev: ## Validate agent discovery without a LiveKit server (set --agents-dir as needed) + uv run openrtc list ./examples/agents \ + --default-stt "deepgram/nova-3:multi" \ + --default-llm "openai/gpt-4.1-mini" \ + --default-tts "cartesia/sonic-3" + +clean: ## Remove build artefacts and __pycache__ directories + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + rm -rf dist build .coverage coverage.xml htmlcov .mypy_cache .ruff_cache diff --git a/src/openrtc/pool.py b/src/openrtc/pool.py index 792fb26..d68b559 100644 --- a/src/openrtc/pool.py +++ b/src/openrtc/pool.py @@ -8,6 +8,7 @@ import os import pickle import sys +import warnings from collections.abc import Callable, Mapping from dataclasses import dataclass, field from functools import partial @@ -700,6 +701,16 @@ def _extract_deprecated_turn_options(session_kwargs: dict[str, Any]) -> dict[str for key in _DEPRECATED_TURN_HANDLING_KEYS: if key in session_kwargs: deprecated_options[key] = session_kwargs.pop(key) + if deprecated_options: + found = ", ".join(f"'{k}'" for k in deprecated_options) + warnings.warn( + f"Passing {found} as top-level session_kwargs keys is deprecated and will " + "be removed in a future release. Use the turn_handling dict instead: " + "session_kwargs={'turn_handling': {'endpointing': {...}, 'interruption': {...}}}. " + "See the AgentPool.add() docstring for the supported turn_handling structure.", + DeprecationWarning, + stacklevel=4, + ) return deprecated_options diff --git a/tests/test_pool.py b/tests/test_pool.py index fae156e..fc507de 100644 --- a/tests/test_pool.py +++ b/tests/test_pool.py @@ -3,6 +3,7 @@ import asyncio import pickle import sys +import warnings from pathlib import Path from types import SimpleNamespace @@ -615,3 +616,79 @@ class NotGiven: pass assert _is_not_given(NotGiven()) is False + + +def test_deprecated_session_kwargs_warning( + monkeypatch: pytest.MonkeyPatch, +) -> None: + pool = AgentPool() + + class FakeSession: + def __init__(self, **kwargs: object) -> None: + self.kwargs = kwargs + + async def start(self, *, agent: object, room: object) -> None: + return None + + monkeypatch.setattr("openrtc.pool.AgentSession", FakeSession) + pool.add( + "test", + DemoAgent, + session_kwargs={ + "min_endpointing_delay": 0.3, + "allow_interruptions": False, + }, + ) + ctx = SimpleNamespace( + job=SimpleNamespace(metadata={"agent": "test"}), + room=SimpleNamespace(metadata=None, name="test-room"), + proc=SimpleNamespace( + userdata={"vad": "vad", "turn_detection_factory": lambda: "td"}, + inference_executor=None, + ), + ) + + async def do_connect(self: object) -> None: + return None + + ctx.connect = do_connect.__get__(ctx, type(ctx)) # type: ignore[attr-defined] + + with pytest.warns(DeprecationWarning, match="turn_handling"): + asyncio.run(pool._handle_session(ctx)) + + +def test_no_warning_for_modern_session_kwargs( + monkeypatch: pytest.MonkeyPatch, +) -> None: + pool = AgentPool() + + class FakeSession: + def __init__(self, **kwargs: object) -> None: + self.kwargs = kwargs + + async def start(self, *, agent: object, room: object) -> None: + return None + + monkeypatch.setattr("openrtc.pool.AgentSession", FakeSession) + pool.add( + "test", + DemoAgent, + session_kwargs={"preemptive_generation": True, "max_tool_steps": 3}, + ) + ctx = SimpleNamespace( + job=SimpleNamespace(metadata={"agent": "test"}), + room=SimpleNamespace(metadata=None, name="test-room"), + proc=SimpleNamespace( + userdata={"vad": "vad", "turn_detection_factory": lambda: "td"}, + inference_executor=None, + ), + ) + + async def do_connect(self: object) -> None: + return None + + ctx.connect = do_connect.__get__(ctx, type(ctx)) # type: ignore[attr-defined] + + with warnings.catch_warnings(): + warnings.simplefilter("error", DeprecationWarning) + asyncio.run(pool._handle_session(ctx)) diff --git a/tests/test_routing.py b/tests/test_routing.py index 508dd27..a9575fc 100644 --- a/tests/test_routing.py +++ b/tests/test_routing.py @@ -99,7 +99,7 @@ def pool() -> AgentPool: pool.add( "dental", DentalAgent, - session_kwargs={"allow_interruptions": False, "max_tool_steps": 5}, + session_kwargs={"max_tool_steps": 5}, ) return pool @@ -229,8 +229,8 @@ def test_handle_session_supports_direct_session_kwargs( pool.add( "dental", DentalAgent, - session_kwargs={"allow_interruptions": False}, - allow_interruptions=True, + session_kwargs={"preemptive_generation": False}, + preemptive_generation=True, max_tool_steps=6, ) ctx = FakeJobContext(job_metadata={"agent": "dental"}) @@ -239,6 +239,7 @@ def test_handle_session_supports_direct_session_kwargs( session = FakeSession.instances[0] assert session.kwargs["max_tool_steps"] == 6 + assert session.kwargs["preemptive_generation"] is True assert session.kwargs["turn_handling"]["interruption"]["mode"] == "vad" From 46cc79e9934d68adf093db11f6cfc0df3a45270d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 20:56:59 +0000 Subject: [PATCH 3/4] docs: move CHANGELOG to docs site with auto-update on release Co-authored-by: mahimairaja <81288263+mahimairaja@users.noreply.github.com> Agent-Logs-Url: https://github.com/mahimairaja/openrtc-python/sessions/54882aec-4789-4d45-a056-603f379337d6 --- .github/workflows/publish.yml | 61 ++++++++++++++++++++++++++----- docs/.vitepress/config.ts | 1 + CHANGELOG.md => docs/changelog.md | 44 +++++++++------------- 3 files changed, 71 insertions(+), 35 deletions(-) rename CHANGELOG.md => docs/changelog.md (74%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0db2661..95ab9ab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,23 +20,66 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + # Use a PAT so the changelog commit can trigger deploy-docs.yml. + # Falls back to GITHUB_TOKEN if the secret is absent (docs won't + # auto-deploy in that case, but the publish still succeeds). + token: ${{ secrets.CHANGELOG_PUSH_TOKEN || secrets.GITHUB_TOKEN }} - - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: python-version: "3.12" - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: | - python -m build + run: uv build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: dist/ + + - name: Update docs/changelog.md + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + RELEASE_BODY: ${{ github.event.release.body }} + RELEASE_DATE: ${{ github.event.release.published_at }} + run: | + python3 - <<'PYEOF' + import os, re + + tag = os.environ["RELEASE_TAG"] + body = os.environ["RELEASE_BODY"].strip() + # published_at is ISO-8601; keep only the date part + date = os.environ["RELEASE_DATE"][:10] + + new_section = f"## [{tag}] - {date}\n\n{body}\n\n---\n\n" + + path = "docs/changelog.md" + with open(path) as f: + content = f.read() + + marker = "" + if marker not in content: + raise SystemExit(f"Marker '{marker}' not found in {path}") + + # Insert the new release section right after the marker line + content = content.replace( + marker + "\n", + marker + "\n\n" + new_section, + 1, + ) + + with open(path, "w") as f: + f.write(content) + + print(f"Prepended {tag} ({date}) to {path}") + PYEOF + + - name: Commit and push changelog + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add docs/changelog.md + git commit -m "docs(changelog): add ${{ github.event.release.tag_name }} release notes [skip ci]" + git push origin HEAD:main diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 0d902ce..9ef5424 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -46,6 +46,7 @@ export default defineConfig({ { text: 'AgentPool API', link: '/api/pool' }, { text: 'CLI', link: '/cli' }, { text: 'Examples', link: '/examples' }, + { text: 'Changelog', link: '/changelog' }, { text: 'GitHub Pages Deployment', link: '/deployment/github-pages' }, ], }, diff --git a/CHANGELOG.md b/docs/changelog.md similarity index 74% rename from CHANGELOG.md rename to docs/changelog.md index c9c7232..19490b5 100644 --- a/CHANGELOG.md +++ b/docs/changelog.md @@ -1,29 +1,21 @@ # Changelog -All notable changes to this project will be documented in this file. +All notable changes to this project are documented here. +Entries are added automatically when a new GitHub release is published. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --- ## [Unreleased] -### Added -- `DeprecationWarning` is now emitted when deprecated top-level `session_kwargs` - keys (e.g. `allow_interruptions`, `min_endpointing_delay`) are passed. - Migrate to the `turn_handling` dict — see `AgentPool.add()` docstring. -- GitHub issue templates for bug reports and feature requests. -- `Makefile` with shortcuts for common developer commands (`make test`, - `make lint`, `make format`, `make typecheck`). -- `.env.example` documenting all supported environment variables. - -### Changed -- CI test and lint workflows migrated from bare `pip` to `uv` with lockfile - caching, matching the `uv sync --group dev` workflow in `CONTRIBUTING.md`. +Changes that have landed on `main` but have not yet been tagged for release. --- + + ## [0.0.15] - 2026-03-22 ### Fixed @@ -36,6 +28,17 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht arguments. - CLI: positional agents dir and metrics JSONL path on `start`/`dev`/`console`. - CLI: `openrtc tui` defaults `--watch` to `./openrtc-metrics.jsonl`. +- `DeprecationWarning` emitted when deprecated `session_kwargs` top-level keys + (e.g. `allow_interruptions`, `min_endpointing_delay`) are used instead of the + `turn_handling` dict. +- GitHub issue templates for bug reports and feature requests. +- `Makefile` with shortcuts for common developer commands (`make test`, + `make lint`, `make format`, `make typecheck`). +- `.env.example` documenting all supported environment variables. + +### Changed +- CI test and lint workflows migrated from bare `pip` to `uv` with lockfile + caching, matching the `uv sync --group dev` workflow in `CONTRIBUTING.md`. --- @@ -129,14 +132,3 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht - Greeting support via `session.generate_reply()`. - `openrtc[cli]` optional extra for `rich`/`typer` CLI. - PEP 561 `py.typed` marker shipped in the wheel. - -[Unreleased]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.15...HEAD -[0.0.15]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.14...v0.0.15 -[0.0.14]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.13...v0.0.14 -[0.0.13]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.12...v0.0.13 -[0.0.12]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.11...v0.0.12 -[0.0.11]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.9...v0.0.11 -[0.0.9]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.8...v0.0.9 -[0.0.8]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.5...v0.0.8 -[0.0.5]: https://github.com/mahimairaja/openrtc-python/compare/v0.0.2...v0.0.5 -[0.0.2]: https://github.com/mahimairaja/openrtc-python/releases/tag/v0.0.2 From cc80a7cdec784b62d73c447c3636b4cb12ba4881 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:37:32 +0000 Subject: [PATCH 4/4] fix: apply reviewer feedback (publish.yml, Makefile, .env.example, pool.py stacklevel) Co-authored-by: mahimairaja <81288263+mahimairaja@users.noreply.github.com> Agent-Logs-Url: https://github.com/mahimairaja/openrtc-python/sessions/fe3f281d-4630-48bf-93c8-eef92e76c1a5 --- .env.example | 2 +- .github/workflows/publish.yml | 33 +++++++++++++++++++++------------ Makefile | 2 +- src/openrtc/pool.py | 2 +- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index bdd3cbf..c8d583d 100644 --- a/.env.example +++ b/.env.example @@ -5,9 +5,9 @@ # --------------------------------------------------------------------------- # LiveKit connection (required for dev / start / connect / console) # --------------------------------------------------------------------------- -LIVEKIT_URL=ws://localhost:7880 LIVEKIT_API_KEY=devkey LIVEKIT_API_SECRET=secret +LIVEKIT_URL=ws://localhost:7880 # --------------------------------------------------------------------------- # Provider API keys — set only the keys for providers your agents use diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 95ab9ab..51dffce 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,9 +16,10 @@ jobs: contents: write steps: - - name: Checkout code + - name: Checkout main uses: actions/checkout@v4 with: + ref: main fetch-depth: 0 # Use a PAT so the changelog commit can trigger deploy-docs.yml. # Falls back to GITHUB_TOKEN if the secret is absent (docs won't @@ -46,9 +47,11 @@ jobs: RELEASE_DATE: ${{ github.event.release.published_at }} run: | python3 - <<'PYEOF' - import os, re + import os - tag = os.environ["RELEASE_TAG"] + raw_tag = os.environ["RELEASE_TAG"] + # Strip leading 'v' to keep headings like "## [0.0.16]" consistent + tag = raw_tag.lstrip("v") body = os.environ["RELEASE_BODY"].strip() # published_at is ISO-8601; keep only the date part date = os.environ["RELEASE_DATE"][:10] @@ -63,17 +66,23 @@ jobs: if marker not in content: raise SystemExit(f"Marker '{marker}' not found in {path}") - # Insert the new release section right after the marker line - content = content.replace( - marker + "\n", - marker + "\n\n" + new_section, - 1, - ) + # Skip if this release was already recorded (idempotent re-runs) + if f"## [{tag}]" in content: + print(f"Section for {tag} already present in {path}; skipping.") + else: + # Insert the new release section right after the marker line. + # Match "marker\n\n" so the replacement keeps exactly two newlines + # between the marker and the new (and subsequent) sections. + content = content.replace( + marker + "\n\n", + marker + "\n\n" + new_section, + 1, + ) - with open(path, "w") as f: - f.write(content) + with open(path, "w") as f: + f.write(content) - print(f"Prepended {tag} ({date}) to {path}") + print(f"Prepended {tag} ({date}) to {path}") PYEOF - name: Commit and push changelog diff --git a/Makefile b/Makefile index e05f662..03ff1ea 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # All commands delegate to `uv run` so they pick up the locked dev environment. # Run `uv sync --group dev` once to set up the environment, then use these targets. -.PHONY: help install test lint format typecheck dev clean +.PHONY: help install test test-fast lint format format-check typecheck dev clean help: ## Show this help message @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ diff --git a/src/openrtc/pool.py b/src/openrtc/pool.py index d68b559..71f0ddf 100644 --- a/src/openrtc/pool.py +++ b/src/openrtc/pool.py @@ -709,7 +709,7 @@ def _extract_deprecated_turn_options(session_kwargs: dict[str, Any]) -> dict[str "session_kwargs={'turn_handling': {'endpointing': {...}, 'interruption': {...}}}. " "See the AgentPool.add() docstring for the supported turn_handling structure.", DeprecationWarning, - stacklevel=4, + stacklevel=3, ) return deprecated_options