Skip to content

fix(insights): allow self-hosted analysis replies - #852

Merged
izadoesdev merged 2 commits into
stagingfrom
codex/selfhost-insights-replies
Sep 21, 2026
Merged

izadoesdev merged 2 commits into
stagingfrom
codex/selfhost-insights-replies

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

With SELFHOST=true, starting a new analysis from an existing investigation was accepted by the API but failed in the worker because it required hosted billing terms. Skip that reservation block only in self-host mode; hosted instances with SELFHOST unset or false retain the existing billing checks.

Validation

  • bun run lint passed, including 26 policy tests.
  • bun run check-types passed all 33 tasks.
  • Insights unit suite: 692 passed, 6 live-provider tests skipped, 0 failed.
  • The reply regression covers unset, false, and true modes. The self-host case fails on the previous implementation and passes with this fix; hosted cases still reject unconfigured billing before analysis work.

Tests used synthetic data and inert local service URLs. No live provider, production database, or deployment was used.

Scope and overlaps

Only the reply worker and its existing regression test change. #849, #850, and #851 also touch Insights, but their current file sets do not overlap this change. No dependency on those PRs.


Summary by cubic

Fixes failed analysis replies on self-hosted instances by skipping the hosted billing reservation when SELFHOST=true.

  • Self-hosted instances no longer require hosted billing terms to start a new analysis from an existing investigation.
  • Hosted instances (SELFHOST unset or false) keep the existing billing checks.

Written for commit 88557fb. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
databuddy-status Ready Ready Preview Sep 21, 2026 2:23pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
dashboard Skipped Skipped Sep 21, 2026 2:23pm UTC
documentation Skipped Skipped Sep 21, 2026 2:23pm UTC

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b2dad7bc-e5e0-41fb-9deb-1e559f6c6761

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@unkey-deploy

unkey-deploy Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 21, 2026 2:23pm

@greptile-apps

greptile-apps Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the self-host exemption narrowly scoped and hosted billing behavior retained.

Summary

This PR allows analysis replies to proceed on self-hosted instances without applying hosted billing requirements.

  • Skips billing resolution and charge reservation for analysis replies when SELFHOST=true.
  • Preserves existing billing enforcement when SELFHOST is unset or false.
  • Adds regression coverage for all three environment configurations.
  • Replaces the previously flagged conditional assertions with explicit table-driven expectations.

Reviews (2) · Last reviewed commit: "test(insights): make self-host billing e..."

Comment thread apps/insights/src/resume-clarification.test.ts
@izadoesdev

Copy link
Copy Markdown
Member Author

@greptile review

Please review final head 88557fb after the test cleanup and rebase onto staging. The original feedback is addressed and all local checks passed.

@izadoesdev
izadoesdev merged commit 30430fb into staging Sep 21, 2026
21 checks passed
@izadoesdev
izadoesdev deleted the codex/selfhost-insights-replies branch September 21, 2026 14:27

This branch was successfully deployed

2 active and 2 inactive deployments
Preview – databuddy-status — 88557fb3 Deployed Sep 21, 2026 by vercel[bot]
links - preview — 88557fb3 Deployed Sep 21, 2026 by unkey-deploy[bot]
Preview – documentation — 88557fb3 Deployed Sep 21, 2026 by vercel[bot]
Preview – dashboard — 88557fb3 Deployed Sep 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant