Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/moonshine-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Moonshine runtime integration tests

on:
push:
paths:
- "run_archive.py"
- "archive-format-specification.md"
- "skills/**"
- "tests/integration_run_archive_moonshine.py"
- ".github/workflows/moonshine-integration-tests.yml"
pull_request:
paths:
- "run_archive.py"
- "archive-format-specification.md"
- "skills/**"
- "tests/integration_run_archive_moonshine.py"
- ".github/workflows/moonshine-integration-tests.yml"

permissions:
contents: read

env:
MOONSHINE_COMMIT: 72a64f8984e0e7e1b0a50f6e53e4d00e4fffbb7d

jobs:
moonshine-integration:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out Creative-Intelligence
uses: actions/checkout@v7

- name: Set up Python 3.11
uses: actions/setup-python@v7
with:
python-version: "3.11"

- name: Install pinned Moonshine runtime
run: |
python -m pip install --upgrade pip
python -m pip install --no-deps "git+https://github.com/DeepMathLLM/Moonshine.git@${MOONSHINE_COMMIT}"

- name: Run deterministic Moonshine integration tests
run: python -m unittest -v tests.integration_run_archive_moonshine
21 changes: 15 additions & 6 deletions run_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,13 +857,22 @@ def _render_material_paths(staged: Sequence[Dict[str, object]]) -> str:
def _open_or_create_session(app: MoonshineApp, object_job: ObjectJob, item_state: Dict[str, object]) -> ShellState:
session_id = str(item_state.get("session_id") or "").strip()
if session_id:
shell_state = app.start_shell_state(session_id=session_id)
if shell_state.project_slug != object_job.project_slug:
raise RunnerError(
"session %s belongs to project %s, expected %s"
% (session_id, shell_state.project_slug, object_job.project_slug)
try:
return app.start_shell_state(
session_id=session_id,
mode="chat",
project_slug=object_job.project_slug,
agent_slug=AGENT_SLUG,
)
return shell_state
except ValueError as exc:
session_meta = app.session_store.get_session_meta(session_id) or {}
actual_project = str(session_meta.get("project_slug") or "")
if actual_project and actual_project != object_job.project_slug:
raise RunnerError(
"session %s belongs to project %s, expected %s"
% (session_id, actual_project, object_job.project_slug)
) from exc
raise RunnerError("session %s is incompatible with archive runner: %s" % (session_id, exc)) from exc
return app.start_shell_state(
mode="chat",
project_slug=object_job.project_slug,
Expand Down
Loading