Skip to content

chore: add obfuscation - #41

Merged
quickbeard merged 1 commit into
mainfrom
obfuscate
Apr 23, 2026
Merged

quickbeard merged 1 commit into
mainfrom
obfuscate

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

No description provided.

@quickbeard
quickbeard merged commit fa05808 into main Apr 23, 2026
2 checks passed
@quickbeard
quickbeard deleted the obfuscate branch April 23, 2026 03:29
quickbeard added a commit that referenced this pull request Sep 10, 2026
…gs, validate keys via /v1/models (#265)

The hub's CoDev Code configuration stopped fitting how the agent works.
Three mismatches with codev-code main (packages/codev-gateway, the
config layer, the desktop gateway controller), each fixed here:

1. The writer whole-file-replaced ~/.config/codev/codev.json(c), carrying
   only `mcp` across. CoDev Code is a standalone product now: its TUI
   connects custom providers, its desktop app writes theme/keybind/
   permission settings, users keep comments in codev.jsonc — and the hub
   rewrites this file on every gateway-key auto-refresh and model switch,
   not just at install. All of that was deleted on each run.
   `configureOpenCodeKind` now PATCHes the file through jsonc-parser the
   way the agent's own `Config.updateGlobal` does: `$schema` seeded only
   when absent, `compaction.auto`/`reserved` set key-by-key, the CoDev
   `provider.<id>` block replaced wholesale (stale models and any inline
   apiKey go), everything else byte-identical. The agent's PATCH cannot
   delete, so convergence after the AIGW rename is the hub's job: other
   CoDev provider ids (`netgate`, `aigateway`, …) and a CoDev-authored
   top-level `model` pin are removed; a user's own provider never is.
   Syntax errors or a non-object root still fall back to a fresh file,
   with the backup holding the original. `readPreservedMcp` is gone —
   nothing needs carrying over any more.

2. `runAgent("codev")` set OPENCODE_DISABLE_AUTOUPDATE, but the fork
   renamed every OPENCODE_* env var to CODEV_* (codev-code #41), so the
   agent's self-updater was never disabled and raced `codevhub update`.
   Both spellings are set now.

3. `validateApiKey` probed LiteLLM's /key/info at the gateway ROOT. That
   root is now fronted by a web app whose catch-all answers HTTP 200 +
   HTML to any bearer — verified with a bogus key — so the probe could
   never return false: the launch-time refresh never fired on an expired
   key and SetupApp's "reuse existing key" offered dead keys as valid.
   It now lists /v1/models (authenticated by the key itself, 401s
   properly) and treats a non-JSON 200 as "can't tell", never "valid".
   `doctor` reports the same URL.

Verified against the real agent: patching a copy of a live codev.jsonc
that carried duplicate netgate + aigw blocks, a comment, a theme, a
custom provider and the CodeGraph mcp entry, then running `codev models`
under that HOME, lists each aigw model once plus the custom provider —
with the comment and settings intact.

Tests: writer tests now assert preservation (settings, comments, in-TUI
providers, compaction siblings, $schema), legacy-block and pin removal,
and the corrupt-file fallback; validateApiKey tests target /v1/models
and pin the HTML-200 case; run tests assert both autoupdate flags.


Claude-Session: https://claude.ai/code/session_0178nPaQqSGVe7Y1fR2ovDTK

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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