Menu โ–พ โ–ด

#351 chore(release): merge pre-main staging branch into main

closed
nobody
None
2026-06-27
2026-06-27
Anonymous
No

Originally created by: Akarsh-Hegde

Summary

This is a comprehensive staging merge that bundles 275 commits of development work from pre-main into main. The branch has been thoroughly tested through the staging release pipeline and encompasses major features, stability fixes, and infrastructure improvements.

Major Features

1. Multi-Model Provisioning Pipeline (PR [#344])

  • Implemented full provisioning of all three required models: LLM, reranker, and embedder
  • Added real-time progress tracking for model downloads with heuristic-based speed calculation
  • Integrated background downloading with UI feedback during first-run setup
  • Addresses the 3-model bootstrapping issue where onboarding previously prefetched only the LLM

2. In-Process OAuth Integration (PR [#338])

  • Implemented PKCE-based OAuth flow for Jira and Linear integrations
  • Added browser-driven in-process authentication with no external dependencies
  • Maintains backward compatibility with token-based fallback
  • Reduces credential management friction in the onboarding flow

3. Prefetch Stability & Performance (PR [#350])

  • Critical fix: Disabled HuggingFace Xet for model downloads to resolve 4+ hour hangs at 57% progress
  • Implemented bounded retry-with-resume mechanism for resumable download failures
  • Improved robustness of the download loop against transient network errors
  • Downloads are now link-bound rather than hanging on stalled checksums

4. In-Process Capture Foundation (Branch: feat/in-process-capture)

  • Migrated screen capture to run in-process within the tray binary
  • Eliminates dependency on child screenpipe process
  • Reduced TCC permission prompts from multiple entries to single "Screen Recording" entry
  • Prerequisite for Bucket 2 cutover; Bucket 1 implementation landed in PR [#321]

5. Enhanced Observability

  • Auto-sync of OpenObserve dashboards on git push
  • Full OTLP tracing export for ML model inference and daemon telemetry
  • Structured logging across Python services and Rust daemon

Stability Improvements

  • capture: Fall back to OCR when browser accessibility tree is Chrome-only
  • etl: Suppress VS Code frames when focused terminal is a coding agent (reduces false activity classification)
  • setup: Comprehensive code review findings addressed across multiple PRs (#341, [#342], [#343], [#346], [#347], [#348])
  • integrations: Fixed OAuth initialization and removed debug-mode credential leaks

Testing & Validation

  • All commits pass cargo fmt, cargo clippy -D warnings, cargo test
  • UI builds successfully with no TypeScript errors
  • Security audit passes with no findings
  • Staging release pipeline validated with auto-update channel
  • Integration tests maintained for ETL pipeline changes

Migration Notes

  • No database migrations required for this merge
  • Environment variable changes are additive (backward compatible with existing .env files)
  • Existing Jira/Linear token credentials continue to work (OAuth is opt-in)
  • No breaking changes to daemon or UI APIs
  • [#350]: Fix prefetch Xet hangs
  • [#348]: Prefetch speed calculation refinement
  • [#346]: Capture frame filtering for coding agents
  • [#345]: ETL VS Code terminal suppression
  • [#344]: Multi-model provisioning
  • [#343]: Prefetch and setup review follow-ups
  • [#342]: OAuth review follow-ups
  • [#338]: In-process OAuth implementation

Branch Status

  • Parent: main (1.62.0)
  • Status: All checks passing, ready for merge
  • Automated Merge: Enabled via semantic-release after approval

๐Ÿค– Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
  • Prefetch downloads now retry automatically on transient failures, improving reliability for large model downloads.
  • Downloads now use the standard Hugging Face transfer path to avoid issues with alternate transfer behavior.
  • Prefetch status updates now better reflect actual progress and estimated speed during download.

  • Chores

  • Added support for configuring the maximum number of prefetch retry attempts via an environment setting.

Related

Tickets: #321
Tickets: #338
Tickets: #342
Tickets: #343
Tickets: #344
Tickets: #345
Tickets: #346
Tickets: #347
Tickets: #348
Tickets: #350

Discussion

  • Anonymous

    Anonymous - 2026-06-27

    Originally posted by: coderabbitai[bot]

    Review Change Stack

    ๐Ÿ“ Walkthrough ## Walkthrough Prefetch downloads now read `MERIDIAN_PREFETCH_MAX_ATTEMPTS`, disable the Hugging Face Xet transfer path, and retry `snapshot_download(...)` with capped backoff. The `/prefetch_status` comments now describe byte-delta speed tracking and shared mutable state. ## Changes **Prefetch retry flow** |Layer / File(s)|Summary| |---|---| |**Retry config and download loop**
    `services/agents/routes/prefetch.py`|Parses `MERIDIAN_PREFETCH_MAX_ATTEMPTS` at import time, forces `HF_HUB_DISABLE_XET`, retries `snapshot_download(...)` with exponential backoff up to the configured limit, and updates `/prefetch_status` comments to describe byte-delta speed tracking and shared mutable state.| ## Sequence Diagram(s) :::mermaid sequenceDiagram participant "prefetch.py" as prefetch participant "os.environ" as env participant "hf_constants" as hf participant "snapshot_download" as download prefetch->>env: read MERIDIAN_PREFETCH_MAX_ATTEMPTS prefetch->>hf: set HF_HUB_DISABLE_XET = True prefetch->>download: call snapshot_download(...) download-->>prefetch: raise on failure prefetch->>prefetch: wait with exponential backoff prefetch->>download: retry until max attempts ## Estimated code review effort ๐ŸŽฏ 4 (Complex) | โฑ๏ธ ~40 minutes ## Possibly related PRs - [[Meridiona/meridian#349](https://github.com/Meridiona/meridian/issues/349)](https://github.com/Meridiona/meridian/pull/349): Touches the same `services/agents/routes/prefetch.py` progress and speed-tracking code paths. ## Poem > I hopped through retries, soft and slow, > With Xet left out and caches in tow. > A byte-delta breeze sang small and bright, > Till downloads landed snug and right. > ๐Ÿ‡
    ๐Ÿšฅ Pre-merge checks | โœ… 5
    โœ… Passed checks (5 passed) | Check name | Status | Explanation | | :------------------------: | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | โœ… Passed | The title accurately reflects that this is a staging-branch merge into main, which matches the PR's overall purpose. | | Description check | โœ… Passed | The description covers the PR summary, testing, checklist notes, and related PRs, so it is mostly complete despite not matching the template exactly. | | Docstring Coverage | โœ… Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. | | Linked Issues check | โœ… Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | โœ… Passed | Check skipped because no linked issues were found for this pull request. |
    โœจ Finishing Touches
    ๐Ÿ“ Generate docstrings - [ ] Create stacked PR - [ ] Commit on current branch
    ๐Ÿงช Generate unit tests (beta) - [ ] Create PR with unit tests - [ ] Commit unit tests in branch `pre-main`

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

     
  • Anonymous

    Anonymous - 2026-06-27

    Originally posted by: Akarsh-Hegde

    CodeRabbit Review Findings โ€” Response

    โœ… Fixed โ€” _env_positive_int() parsing logic (lines 95-102)

    The retry override parsing in MERIDIAN_PREFETCH_MAX_ATTEMPTS now properly validates positive integers:

    Before:

    return max(1, int(raw))  # silently clamps 0/-5 to 1
    

    After:

    val = int(raw)
    if val <= 0:
        log.warning("server: ignoring non-positive env override; using default", ...)
        return default
    return val
    

    Now rejects 0 or negative values with a warning and returns the default (5), consistent with the ValueError fallback behavior. Prevents invalid settings from being silently converted into different retry policies.

    โœ… Fixed โ€” Try-except block structure (line 150)

    Moved the successful download return into an else block for clarity (Ruff TRY300):

    Before:

    try:
        snapshot_download(...)
        return
    except Exception as exc:
        ...
    

    After:

    try:
        snapshot_download(...)
    except Exception as exc:
        ...
    else:
        return  # download succeeded
    

    โญ๏ธ Skipped โ€” Performance warning on try-except in loop (PERF203, lines 151-163)

    This is a bounded retry loop with max 5 attempts. The performance overhead of try-except at this scale is negligible. The existing # noqa: BLE001 comment already documents the intentional broad exception catch for retry-with-resume semantics. No structural change needed.


    All pre-push checks pass โœ“

     
  • Anonymous

    Anonymous - 2026-06-27

    Ticket changed by: Akarsh-Hegde

    • status: open --> closed
     

Log in to post a comment.