Skip to content

Edit prompt - #1

Closed
jahooma wants to merge 8 commits into
mainfrom
edit-prompt
Closed

jahooma wants to merge 8 commits into
mainfrom
edit-prompt

Conversation

@jahooma

@jahooma jahooma commented Aug 29, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@jahooma jahooma closed this May 6, 2025
jahooma added a commit that referenced this pull request Jul 21, 2025
jahooma added a commit that referenced this pull request Jul 21, 2025
jahooma added a commit that referenced this pull request May 4, 2026
Five attempts to embed the wasm into the bun --compile binary all
failed on Windows in different ways. Each one's bytes ended up in the
binary (we verified this directly), but every JS-level retrieval
mechanism we tried got stripped by the time the runtime ran:

  1. `with { type: 'file' }` of `web-tree-sitter/tree-sitter.wasm`
     subpath — bytes embedded, import variable bound to undefined.
  2. `with { type: 'file' }` of a copied-in relative .wasm — same as #1.
  3. Single 274KB base64 string literal — got dropped by the minifier.
  4. ~268 chunked base64 string literals — same fate.
  5. Function-export wrapping the chunked array, with eager file write
     verification on disk — chunks confirmed on disk after embed,
     still not present in the compiled output.

The bun-compile-on-Windows code path is doing something destructive
to JS-source-level wasm asset references that we cannot reliably
work around from the source. So bypass the bundler entirely: ship
tree-sitter.wasm as a *sibling file* next to the binary.

- cli/scripts/build-binary.ts: copies the wasm from node_modules to
  cli/bin/tree-sitter.wasm after `bun build --compile`, alongside the
  binary. Drops all the embed/verify machinery from previous rounds.
- cli/src/pre-init/tree-sitter-wasm.ts: at runtime, looks for
  `dirname(process.execPath)/tree-sitter.wasm`, sets the env var that
  init-node.ts reads, and (best-effort) reads the bytes synchronously
  to publish on globalThis for the wasmBinary fast path. Both
  channels feed the same SDK init.
- cli/src/pre-init/tree-sitter-wasm-bytes.ts: deleted. No more
  generated module.
- .github/workflows/cli-release-build.yml: tarball includes
  `tree-sitter.wasm` next to the binary (both matrix and Windows-
  specific job).
- cli/release/index.js + freebuff/cli/release/index.js: the npm
  postinstall downloader now also moves tree-sitter.wasm out of the
  temp extraction dir to live next to the installed binary.

Verified locally: build copies the wasm into bin/, --smoke-tree-sitter
exits 0 with "tree-sitter smoke ok (wasmBinary, 205488 bytes)", full
boot smoke passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EstarinAzx referenced this pull request in EstarinAzx/codebuff-modded May 19, 2026
The Path C dispatch in getModelForRequest was ~50 lines of fork-only
logic in-place edited into the upstream resolver (active profile lookup,
per-agent binding, oauth vs direct sub-branch, model resolution), plus
~150 lines of fork-only state and helpers (BYOKProfile type, normalize,
setters/getters, createDirectProviderModel). Total ~210 lines of fork
edits in the upstream file.

Moved all of that to sdk/src/impl/fork-impls/byok-resolver.ts. The
upstream getModelForRequest now contains a single line:

    const forked = await getForkHooks().resolveByok?.(params)
    if (forked) return forked

byok-resolver self-registers the hook on module load, so any SDK
consumer that imports a BYOK setter (transitively via model-provider's
re-exports) opts into Path C automatically — same external behavior as
before, no CLI-side wiring required.

Public surface preserved: setActiveByokProfile / getActiveByokProfile /
setByokAgentBindings / getByokAgentBindings / BYOKProfile still resolve
from sdk/src/impl/model-provider (re-exported at file bottom) so
existing import sites in sdk/src/index.ts, database.ts, and the two
BYOK test files compile unchanged.

createOpenAIOAuthModel exported from model-provider so byok-resolver's
Path C-oauth branch (codex preset) reuses the same ChatGPT-backend code
path Path A uses.

Verified by `bun run typecheck` clean + the existing 17 BYOK tests
(model-provider-byok + database-byok-skip) all green.

Reduces upstream merge conflict on model-provider.ts from a ~210-line
block of fork edits to a single-line hook dispatch + a cold bottom-of-
file re-export block.
EstarinAzx referenced this pull request in EstarinAzx/codebuff-modded May 19, 2026
…led binary

Shim CodebuffAI#5-7 (commit 6448174) replaced inline BYOK_AT_BOOT IIFEs in
use-connection-status / use-gravity-ad / use-agent-validation with a
getForkHooks().shouldSkipReactHook?.() lookup. The skip-react-hook impl
self-registered via a side-effect import threaded through index.tsx,
then a tree-shaking allowlist tweak, then a pre-init move.

None of it survived bun --compile. Symptoms in the produced binary:
"connecting..." stuck on, no agent dispatch on first prompt — same
0.1.10 lockout the original BYOK_AT_BOOT IIFEs were added to prevent.
Root cause not fully isolated; bun-compile's bundler interaction with
side-effect imports under workspace package.json sideEffects flags is
the suspect, but rather than keep guessing under the user's time
pressure, restore the working inline IIFEs.

Net effect: the 3 hook files are now byte-identical to modded tip
(zero diff). 9-line shim per file gone. Merge friction for these three
hooks rebuilds back to the 0.1.10 level — accepted trade-off for a
working binary.

skip-react-hook.ts deleted. scripts/check-env-architecture.ts allowlist
re-includes the 3 hook files (they read process.env again).

SDK-side shims (#1, CodebuffAI#2, CodebuffAI#3) stay — they pass tests and aren't on the
broken code path.
JasonMMIV added a commit to JasonMMIV/Anybuff that referenced this pull request Aug 26, 2026
… queue, auto-update

- CodebuffAI#1 Sensitive-file filter: desktop/src/main/file-filter.ts ports upstream
  isSensitiveFile heuristics (keys, SSH privates, kubeconfig, .env, ...) and
  wires into CodebuffClient.run() via the SDK fileFilter option.
- CodebuffAI#2 In-flight message queue: messages typed during a run are parked in
  MessageQueuePanel and dispatched automatically when the turn ends, with
  inline edit / reorder / promote / delete.
- CodebuffAI#3 Auto-update via electron-updater (GitHub Releases): silent check ~20s
  after launch and every 4h, blockmap differential download, Restart &
  Install from About page, install-on-quit fallback; dev/unpackaged falls
  back to a plain GitHub API version check.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
JasonMMIV added a commit to JasonMMIV/Anybuff that referenced this pull request Sep 21, 2026
- GitHub Actions android-release.yml: shared-layer regression gate -> layered
  web/sdk/host-core builds -> pinned runtime fetch -> assembleRelease (version
  derived from desktop/package.json per ADR-14) -> APK + sha256 appended to the
  existing GitHub Release (never overwrites the Windows triad)
- build.gradle.kts: -Panybuff.versionName/versionCode overrides; release
  signing only when ANYBUFF_KEYSTORE_* env is complete, else debug-key fallback
- Check-update chain (plan 4.2 gaps CodebuffAI#1-CodebuffAI#3): shell injects
  __ANYBUFF_UPDATE_REPO__ + __ANYBUFF_UPDATE_APK_FILTER__; githubUpdateCheck
  only treats releases carrying .apk assets as newer and never falls back to
  unfiltered tag compare; SettingsModal splits disabled vs error and routes
  updateDownloadSupported:false results to the release-page modal

Review fixes (2026-09-21): APK filter was dead code (endsWith('-apk') never
true) -> explicit opt-in flag; Android 'available' state stuck on a no-op
background download -> route to release page; CI keystore secrets were never
wired (debug-signed APKs would ship) -> base64 secret materialization with
fail-fast on partial secrets; tag/version equality guard on v* push;
env-indirect inputs.tag interpolation; AbortSignal.timeout guard in WS shim.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
LeverageAISMBs pushed a commit to LeverageAISMBs/codebuff that referenced this pull request Sep 30, 2026
LeverageAISMBs pushed a commit to LeverageAISMBs/codebuff that referenced this pull request Sep 30, 2026
Five attempts to embed the wasm into the bun --compile binary all
failed on Windows in different ways. Each one's bytes ended up in the
binary (we verified this directly), but every JS-level retrieval
mechanism we tried got stripped by the time the runtime ran:

  1. `with { type: 'file' }` of `web-tree-sitter/tree-sitter.wasm`
     subpath — bytes embedded, import variable bound to undefined.
  2. `with { type: 'file' }` of a copied-in relative .wasm — same as CodebuffAI#1.
  3. Single 274KB base64 string literal — got dropped by the minifier.
  4. ~268 chunked base64 string literals — same fate.
  5. Function-export wrapping the chunked array, with eager file write
     verification on disk — chunks confirmed on disk after embed,
     still not present in the compiled output.

The bun-compile-on-Windows code path is doing something destructive
to JS-source-level wasm asset references that we cannot reliably
work around from the source. So bypass the bundler entirely: ship
tree-sitter.wasm as a *sibling file* next to the binary.

- cli/scripts/build-binary.ts: copies the wasm from node_modules to
  cli/bin/tree-sitter.wasm after `bun build --compile`, alongside the
  binary. Drops all the embed/verify machinery from previous rounds.
- cli/src/pre-init/tree-sitter-wasm.ts: at runtime, looks for
  `dirname(process.execPath)/tree-sitter.wasm`, sets the env var that
  init-node.ts reads, and (best-effort) reads the bytes synchronously
  to publish on globalThis for the wasmBinary fast path. Both
  channels feed the same SDK init.
- cli/src/pre-init/tree-sitter-wasm-bytes.ts: deleted. No more
  generated module.
- .github/workflows/cli-release-build.yml: tarball includes
  `tree-sitter.wasm` next to the binary (both matrix and Windows-
  specific job).
- cli/release/index.js + freebuff/cli/release/index.js: the npm
  postinstall downloader now also moves tree-sitter.wasm out of the
  temp extraction dir to live next to the installed binary.

Verified locally: build copies the wasm into bin/, --smoke-tree-sitter
exits 0 with "tree-sitter smoke ok (wasmBinary, 205488 bytes)", full
boot smoke passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
JasonMMIV added a commit to JasonMMIV/Anybuff that referenced this pull request Oct 3, 2026
…v1.4.0)

The optional token (vault id github-token, Authorization header on GitHub
requests) was judged redundant: 60/hr unauthenticated is plenty for manually
installing skills, and the token was an entire extra storage surface —
renderer input + Remove button, saveSettings githubToken/deleteGithubToken
payload fields, DPAPI/Keystore plumbing, and two of the review findings
(CodebuffAI#1 save/delete ordering, CodebuffAI#3 hint copy) existed only for it.

- drop saveGithubToken/getGithubToken/GITHUB_TOKEN_ID,
  AppSettings.githubTokenSet, and the ghFetch Authorization header —
  every GitHub request stays unauthenticated
- rate-limit message keeps the 60/hr explanation (skills plan P1
  acceptance line) without the "set a token" upsell; the 404 message no
  longer suggests tokens for private repos
- remove the Settings UI block, the native-keychain leg, the save/delete
  payload plumbing, and the 3 token tests
- annotate the skills plan P2/R4 with the removal decision
- bump desktop version 1.3.3 -> 1.4.0

Tokens stored by earlier builds stay orphaned in the vault — nothing reads
them anymore, so no migration.
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