Skip to content

fix(replay-vision): clear abort when no framework is detected - #1205

Open
talagluck wants to merge 2 commits into
PostHog:mainfrom
talagluck:fix/replay-vision-empty-repo-detect
Open

fix(replay-vision): clear abort when no framework is detected#1205
talagluck wants to merge 2 commits into
PostHog:mainfrom
talagluck:fix/replay-vision-empty-repo-detect

Conversation

@talagluck

@talagluck talagluck commented Sep 3, 2026

Copy link
Copy Markdown

Summary

  • Running replay-vision against an empty repo (or one with no recognizable framework) surfaced a misleading "Setup instructions for this project failed to download" error, because DETECT_STEP.onReady had no guard for "nothing detected at all" — only for "detected something unsupported." With session.skillId left unset, the orchestrator's preflight failed every mini-skill variant lookup and reported it as a download failure.

  • ciPreRun (the CI/headless path) already handled this correctly by aborting early with ErrorCodes.DetectNoFramework. This adds the equivalent guard to the interactive path, DETECT_STEP.onReady.

  • Since a human is actually present on this path (unlike CI), the abort message goes further than ciPreRun's terse one — it names the problem and what to do about it, matching the tone of the neighboring abortUnsupportedPlatform message:

    Replay vision couldn't detect a framework here, so it has nothing to scope its scanners to.

    Make sure you're running this from your app's root directory (where its package.json or framework-equivalent lives), not an empty or unrelated folder. See what replay supports at:
    https://posthog.com/docs/session-replay

Test plan

  • pnpm vitest run src/lib/programs/__tests__/replay-vision.test.ts — all 6 pass
  • pnpm vitest run src/lib/programs/ — all 264 pass, no regressions
  • npx tsc --noEmit — no new errors introduced by this change
  • eslint / prettier --check — clean
  • Manually reproduced via pnpm try replay-vision --install-dir=<empty-dir> before/after: old code shows the misleading download-failure message, new code shows the clear framework-detection message

talagluck and others added 2 commits September 3, 2026 23:17
…etected

DETECT_STEP.onReady had no guard for the "nothing detected at all" case
(only for "detected something unsupported"), so an empty repo silently
fell through to a null skillId. The orchestrator's preflight then failed
every mini-skill variant lookup and surfaced a generic "failed to
download" abort — misleading, since nothing was actually downloaded or
fetched. Mirrors the guard ciPreRun already has for the CI path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HrhaMpCxKgtFSTAgMUErin
…sage

The interactive path had someone at a terminal who could act on better
guidance, unlike the CI path this message was copied from. Match the
tone of the neighboring abortUnsupportedPlatform: name what's missing,
say what to do about it, link the docs. ciPreRun keeps its terser
message — that one only ever reaches a log line.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HrhaMpCxKgtFSTAgMUErin
@talagluck
talagluck requested a review from a team as a code owner September 3, 2026 21:39
@talagluck
talagluck requested review from TueHaulund, arnohillen, fasyy612 and ksvat and removed request for a team September 3, 2026 21:39
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.

2 participants