Skip to content

feat(parse): support AC-3 audio resources and add multimodal integration tests#3229

Merged
qin-ctx merged 4 commits into
mainfrom
feat/ac3-support
Jul 14, 2026
Merged

feat(parse): support AC-3 audio resources and add multimodal integration tests#3229
qin-ctx merged 4 commits into
mainfrom
feat/ac3-support

Conversation

@Hao-Yu-la

Copy link
Copy Markdown
Collaborator

Description

Add AC-3 audio resource support and introduce a black-box multimodal compatibility test matrix against a deployed OpenViking
service.

The integration tests submit remote file URLs directly through AsyncHTTPClient without mocking parsers, storage, or media
validation.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Added URL detection coverage to ensure remote AC-3 resources retain the .ac3 extension and route to the audio parser.
  • Added a 31-case multimodal integration matrix covering image, audio, video, codec, and document inputs through a real
    deployed OpenViking service.
  • Added support for loading the service URL, API key, and identity fields from the current OV CLI configuration, with
    localhost fallback when no URL is configured.
  • Removed the separate AC-3 parser test in favor of the consolidated multimodal compatibility matrix.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Commands executed:

uv run --active --no-sync pytest -q \
  tests/parse/test_url_filename_preservation.py \
  tests/parse/test_multimodal_file_matrix_integration.py \
  --no-cov

Result:

49 passed, 31 skipped

The complete live matrix was also validated against a deployed OpenViking service with valid credentials:

38 passed

Style validation:

 uv run --active --no-sync ruff check \
    tests/parse/test_multimodal_file_matrix_integration.py

Result:

All checks passed!

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

  • Live integration cases are opt-in through OPENVIKING_RUN_MULTIMODAL_INTEGRATION=1.

  • The tests use add_resource(wait=False) to validate file-format acceptance and resource creation without waiting for
    downstream semantic extraction or embedding queues.

  • A later live rerun was blocked by an invalid API key in the active local CLI configuration; this occurred before resource
    ingestion and is unrelated to format handling.

  • No external dependency changes are required.

@qin-ctx qin-ctx merged commit c6d48bc into main Jul 14, 2026
6 checks passed
@qin-ctx qin-ctx deleted the feat/ac3-support branch July 14, 2026 03:03
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds AC-3 support to the media ingestion pipeline (extension lists, MIME mapping, and magic-byte detection) and introduces an opt-in black-box multimodal integration test matrix that validates ingestion against a live OpenViking service.

Changes:

  • Extend audio format handling to include .ac3 across URL detection, MIME-to-extension mapping, and AudioParser magic-byte checks.
  • Add AC-3-focused URL/GET-fallback tests to ensure .ac3 filenames are preserved even when HEAD fails and content-type is generic.
  • Add an opt-in (env-gated) 31-case multimodal live ingestion matrix, plus local helper/unit tests for client setup and response validation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/parse/test_url_filename_preservation.py Adds coverage ensuring AC-3 URL detection and download preserve .ac3 and route to audio.
tests/parse/test_multimodal_file_matrix_integration.py New opt-in live multimodal ingestion matrix + client config helper tests.
openviking/parse/parsers/media/constants.py Adds .ac3 to supported audio extensions list.
openviking/parse/parsers/media/audio.py Updates supported-format documentation and adds AC-3 magic bytes.
openviking/parse/accessors/mime_types.py Adds audio/ac3.ac3 mapping for extension inference.
openviking/parse/accessors/http_accessor.py Adds AC-3 magic-byte detection for URL type/extension inference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 269 to 272
"audio/flac": [".flac"],
"audio/aac": [".aac"],
"audio/ac3": [".ac3"],
"audio/x-wav": [".wav"],
Comment on lines +328 to +331
monkeypatch.setenv("OPENVIKING_CLI_CONFIG_FILE", str(config_path))
monkeypatch.delenv("OPENVIKING_URL", raising=False)
monkeypatch.delenv("OPENVIKING_BASE_URL", raising=False)
monkeypatch.delenv("OPENVIKING_API_KEY", raising=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants