Skip to content

Fix btca ask failures for streamed auth errors and chipwhisperer sparse checkouts#219

Open
da-beda wants to merge 1 commit into
davis7dotsh:mainfrom
da-beda:codex/fix-btca-ask-chipwhisperer-211
Open

Fix btca ask failures for streamed auth errors and chipwhisperer sparse checkouts#219
da-beda wants to merge 1 commit into
davis7dotsh:mainfrom
da-beda:codex/fix-btca-ask-chipwhisperer-211

Conversation

@da-beda
Copy link
Copy Markdown

@da-beda da-beda commented Mar 24, 2026

Summary

  • preserve streamed BtcaError messages in btca ask instead of surfacing Effect.tryPromise
  • allow sparse checkout updates for submodule-backed searchPaths via --skip-checks

Validation

  • bun test apps/cli/src/commands/ask.test.ts
  • bun test apps/server/src/resources/impls/git.test.ts
  • bun run check:cli
  • bun run check:server

Closes #211

Greptile Summary

This PR fixes two independent bugs: streamed BtcaError messages being swallowed by Effect.tryPromise in the ask command, and git sparse-checkout set failing for submodule-backed search paths in chipwhisperer-style repos.

  • ask.ts: Converts the bare Effect.tryPromise(async () => {...}) call to the { try, catch } overload. The catch handler preserves BtcaError instances thrown by onError (e.g. ProviderNotAuthenticatedError) rather than letting Effect wrap them in a generic "An error occurred in Effect.tryPromise" message. No existing behavior is changed for non-BtcaError throws.
  • git.ts: Extracts the duplicated sparse-checkout set + checkout sequence into an exported syncSparseCheckoutPaths helper and adds --skip-checks to the sparse-checkout set call. The flag is necessary because git rejects paths that resolve to submodule gitlinks without it. The downstream ensureSearchPathsExist check remains in place to catch genuinely missing paths.
  • Both fixes are covered by new, well-scoped tests (a stub SSE server for the CLI fix, and a real local git repo with a submodule for the git fix).

Confidence Score: 5/5

  • Safe to merge — both fixes are targeted, well-tested, and do not break existing behaviour.
  • The Effect.tryPromise change only adds a catch handler that passes BtcaError through unchanged and wraps everything else the same way as before. The --skip-checks change is guarded by the existing ensureSearchPathsExist check so truly invalid paths are still rejected. No regressions identified.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/cli/src/commands/ask.ts Refactored Effect.tryPromise to include a catch handler that preserves BtcaError instances from streamed error events instead of letting Effect wrap them in a generic error message. Clean and targeted fix.
apps/server/src/resources/impls/git.ts Extracted duplicate sparse-checkout logic into a new exported syncSparseCheckoutPaths function and added --skip-checks flag to support submodule-backed search paths. The existing ensureSearchPathsExist validation still guards against truly missing paths.
apps/cli/src/commands/ask.test.ts Adds an integration-style test using a stub Bun server to verify that streamed BtcaError auth messages surface correctly to the user and do not leak the Effect.tryPromise wrapper message.
apps/server/src/resources/impls/git.test.ts Adds a test that sets up a real git repo with a submodule and verifies syncSparseCheckoutPaths works on both the initial clone and a subsequent update — exactly the scenario --skip-checks was needed for.

Reviews (2): Last reviewed commit: "Fix btca ask errors for streamed auth fa..." | Re-trigger Greptile

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 24, 2026

@knauerp is attempting to deploy a commit to the davis7dotsh Team on Vercel.

A member of the Team first needs to authorize it.

@da-beda da-beda force-pushed the codex/fix-btca-ask-chipwhisperer-211 branch from e769483 to 977df1d Compare March 24, 2026 23:51
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.

btca ask fails at 'creating collection' with Effect.tryPromise error (v2.0.5, opencode provider)

1 participant