← Back to Pull requests

fix(devcontainer): use the pgvector Postgres image so document import works #4263

Closed
unknown closed this pull request without merging on Oct 16, 2026 18:59 UTC
View on GitHub
unknown unknown commented on Oct 16, 2026 10:13 UTC
Author

Summary

The devcontainer's db service runs postgres:16, which ships no vector extension. That single mismatch makes document and PDF statement import impossible to test in the devcontainer — the upload option is never rendered.

This contradicts the project's own guidance. docs/hosting/ai.md tells Pgvector users:

Use the pgvector/pgvector:pg16-trixie Docker image instead of postgres:16 (drop-in replacement)

The devcontainer was the one place still on the plain image.

What it breaks

The failure is silent and presents as a missing feature rather than an error:

1. VectorStore::Pgvector.available? checks for the vector extension in pg_available_extensions, finds none, and returns false.
2. VectorStore.adapter is therefore nil, so document_upload_supported_extensions returns [] (app/controllers/imports_controller.rb).
3. imports/new renders its "import from file" row only if @document_upload_extensions.any?.

So the row never appears, and the Financial tools tab of Imports → New offers no way to upload a PDF or CSV. A contributor following the AI docs to test document search or bank-statement extraction finds no upload control and no error to explain it.

Change

Adopts the documented tag verbatim, rather than a nearby one, so the two stay consistent:

db:
    image: pgvector/pgvector:pg16-trixie

Verification

Run against the devcontainer:

  • SELECT name, default_version FROM pg_available_extensions WHERE name='vector' → vector | 0.8.7

  • Existing schema and data survive the container recreate (7,484 transactions intact)

  • VectorStore.adapter resolves to VectorStore::Pgvector, with .pdf among supported_extensions
  • pg16-trixie is a drop-in replacement: same environment variables, same volume mount, same POSTGRES_ defaults, so no other change is required. Once the extension is present the app provisions vector_store_chunks itself on first use.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Bug Fixes
    * Fixed an issue in the development environment that could hide the document and PDF upload option. The database setup now supports the required vector functionality, allowing the upload option to appear as expected.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 296 lines (+222 / -74) across 3 files Reviewer: jjmata Review duration: 526m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 296 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4263"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.0% (MEDIUM) · Higher = larger blast radius
    40.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.8% · Safe to merge
    15.8%