chore(deps): bump hono in lockfile to close Dependabot alert #2 - #105
Merged
Conversation
Closes Dependabot alert #2 (hono <4.12.14, HTML injection in JSX SSR). The lockfile was pinning hono@4.12.12 even though node_modules already had 4.12.16 installed (verified via `npm ls hono`). GitHub reads the lockfile, so the alert kept firing despite the actually-installed version being unaffected. `npm update hono @hono/node-server --include=optional` resolves both to the latest version satisfying the existing transitive constraints (`^4.11.4`, `^4`). Followed by clean install to ensure node_modules matches. - hono: 4.12.12 -> 4.12.16 - @hono/node-server: 1.19.13 -> 1.19.14 - emnapi optional-dep placement reshuffle (npm dedupe, no behavior change) Tests: 1635/1635 passed. tsc clean. lint 0 errors. Note: leaves @anthropic-ai/sdk Dependabot alert #3 untouched -- that one needs an `overrides` block or upstream SDK bump and was flagged for live review with Dylan.
The previous npm install --include=optional regenerated the entire optional-dep tree, removing @emnapi/core@1.10.0 entries that CI's plain 'npm ci' (no --include=optional) needs. Reverting to main's lockfile and only patching the hono and @hono/node-server entries keeps the diff surgical and cross-platform. Verified: 'npm ci' (no flags), 1635/1635 tests, tsc clean, 0 lint errors.
Collaborator
Author
|
CI failed on the first commit ( Root cause: my Fixed in Verified locally:
CI re-running on the new commit. |
claudiusthebot
added a commit
that referenced
this pull request
May 15, 2026
β¦dex-sdk only
CI failed on the initial codex backend PR with:
npm error Missing: @emnapi/core@1.10.0 from lock file
npm error Missing: @emnapi/runtime@1.10.0 from lock file
Root cause: the first `npm install --include=optional` regenerated
the lockfile broadly, dropping main's `node_modules/@emnapi/core` and
`@emnapi/runtime` top-level entries even though three packages
(rolldown wasm bindings) still listed them as dependencies. Bare
`npm ci` (no flags) on a clean runner therefore couldn't resolve
the closure.
This commit uses a Python merge script to take main's lockfile as
base and add ONLY the codex-sdk-specific entries:
- node_modules/@openai/codex
- node_modules/@openai/codex-{darwin,linux,win32}-{arm64,x64}
(per-platform binaries β optional, only one installs per host)
- node_modules/@openai/codex-sdk
Everything else in main's lockfile (tsx@4.21.0, ajv@8.18.0,
@emnapi/core@1.10.0, etc) is preserved byte-for-byte. Result:
- bare `npm ci` passes
- tools/verify-lockfile.sh passes
- tsc clean
- 2274 tests passing, 0 failing
Reapplies the Β§-on-lockfile-bumps lesson from PR #105: when adding a
single new dep, prefer surgical merge over a broad `npm install` so
unrelated transitive versions don't shift.
claudiusthebot
added a commit
that referenced
this pull request
May 15, 2026
* feat(backend): add Codex as a fourth backend provider Wraps `@openai/codex-sdk` (which drives the `codex` CLI from `@openai/codex`) and registers it as `backend: "codex"`. Selectable alongside Claude SDK, Kilo, and OpenCode. Reference design from https://github.com/pingdotgg/t3code β t3code's `effect-codex-app-server` package writes its own JSON-RPC client against the raw Codex `app-server` protocol; Talon takes the lighter path and uses the official `@openai/codex-sdk` which already wraps that protocol cleanly. Architecture: - `constants.ts` β system-prompt suffix, default model (`gpt-5-codex`). - `state.ts` β per-process state container (config, cached Codex instance, gateway port, frontend label). - `mcp-config.ts` β flattens Talon's MCP plugin map into the `mcp_servers.<name>.{command,args,env}` TOML shape Codex's CLI accepts via `--config` overrides. Covers frontend-tools servers, plugin servers, and Brave Search. - `init.ts` β lazy `Codex` instance construction, keyed by active chat id so per-chat MCP isolation survives the CLI's "configure-at-startup" constraint. - `handler.ts` β main message handler. Subscribes to `thread.runStreamed`'s ThreadEvent generator, translates `agent_message` / `mcp_tool_call` items into the shared stream state, persists thread id for `resumeThread()` continuity. Hooks AbortController so terminator tools (end_turn / send / react) can cancel further model generation. - `factory.ts` β `registerBackend({ id: "codex", ... })`. - `index.ts` β barrel. Shared infrastructure reused: - `backend/shared/stream-state` for accumulator. - `backend/shared/delivery` (routeDelivery) for end-of-turn routing. - `backend/shared/{prompt-format,system-prompt,model-retry,session-name,usage}`. - `core/tools/index.isTurnTerminator` for tool-name detection (Codex emits MCP calls with bare tool names, no MCP prefix β `stripMcpPrefix` handles both shapes). Notes / caveats: - The Codex SDK doesn't expose `system` on `runStreamed`. Talon prepends the system prompt to the first user message on first turn; subsequent resumed turns inherit instructions from the persisted thread. - MCP servers are configured at thread-creation time (CLI constraint). Chat-id-keyed cache rebuilds the Codex instance on chat switch so each chat sees its own MCP environment. - Cache-write tokens always reported as 0 β Codex doesn't surface them in `Usage`. Config: - New `backend: "codex"` value accepted by `configSchema`. - New `openaiApiKey` config option (falls back to `OPENAI_API_KEY` env var). Prerequisites for the user: - `npm i -g @openai/codex` (provides the `codex` CLI). - `codex login` (ChatGPT auth) OR `OPENAI_API_KEY` env var OR `openaiApiKey` in `~/.talon/config.json`. Tests: 13 new unit tests in `codex-backend.test.ts` covering constants, state lifecycle, MCP-config flattening (frontend servers, plugin servers, brave-search opt-in, multi-frontend), and factory registration. Full suite 2274 passing (was 2261), 12 skipped (live-tier), 0 failing. README: - Backends badge updated to include Codex. - "Backends" section gains a Codex row. - Prerequisites + config-table rows updated. - Architecture tree adds `codex/`. Live verification: not exercised β requires `codex` CLI installed + OpenAI API key. A `docker/codex-test/` harness can be added in a follow-up similar to `docker/kilo-test/` once the SDK has been shaken out against real usage. * fix(codex): surgically merge lockfile β preserve main's deps + add codex-sdk only CI failed on the initial codex backend PR with: npm error Missing: @emnapi/core@1.10.0 from lock file npm error Missing: @emnapi/runtime@1.10.0 from lock file Root cause: the first `npm install --include=optional` regenerated the lockfile broadly, dropping main's `node_modules/@emnapi/core` and `@emnapi/runtime` top-level entries even though three packages (rolldown wasm bindings) still listed them as dependencies. Bare `npm ci` (no flags) on a clean runner therefore couldn't resolve the closure. This commit uses a Python merge script to take main's lockfile as base and add ONLY the codex-sdk-specific entries: - node_modules/@openai/codex - node_modules/@openai/codex-{darwin,linux,win32}-{arm64,x64} (per-platform binaries β optional, only one installs per host) - node_modules/@openai/codex-sdk Everything else in main's lockfile (tsx@4.21.0, ajv@8.18.0, @emnapi/core@1.10.0, etc) is preserved byte-for-byte. Result: - bare `npm ci` passes - tools/verify-lockfile.sh passes - tsc clean - 2274 tests passing, 0 failing Reapplies the Β§-on-lockfile-bumps lesson from PR #105: when adding a single new dep, prefer surgical merge over a broad `npm install` so unrelated transitive versions don't shift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes Dependabot alert #2 (
hono <4.12.14β HTML injection in JSX SSR, moderate).The lockfile was pinning
hono@4.12.12even thoughnode_modulesalready had4.12.16installed (verified vianpm ls hono). GitHub reads the lockfile to determine vuln status, so the alert kept firing despite the actually-installed version being unaffected.What changed
Surgical edit of
package-lock.json: only the two relevantnode_modules/<pkg>entries (version,resolved,integrity) were touched. Diff vsmainis exactly 6+/6β.Integrity hashes pulled from
npm view <pkg>@<ver> dist.integrity.Why surgical (not
npm install --include=optional)The first attempt on this PR (commit
d36e947) usednpm install --include=optionalto refresh the lockfile. That regenerated the entire optional-dep tree and removed the top-level@emnapi/core@1.10.0entries that plainnpm ci(no flags) needs to satisfy@oxc-parser/binding-wasm32-wasi's transitive deps. CI failed across 7 jobs withMissing: @emnapi/core@1.10.0 from lock file. The--include=optionalapproach produces a lockfile that only validates with the same flag β and CI uses plainnpm ci.Commit
f041f7creverts tomain's lockfile and patches only the two relevant entries, so the lockfile stays portable for plainnpm ci. Lesson encoded in~/.talon/workspace/memory/memory.mdOperational Notes for future heartbeat instances.Test plan
rm -rf node_modules && npm ci(no flags) β succeeds locallynpx vitest runβ 1635/1635 passednpx tsc --noEmitβ cleannpm run lintβ 0 errors (9 pre-existing warnings)f041f7c: 10/10 jobs green in 1m20s (Tests Node 22+24, Functional ubuntu/macos/windows, Fuzz, Code Quality, Security Audit, Docker Build, CodeQL)Out of scope
Leaves Dependabot alert #3 (
@anthropic-ai/sdk <0.91.1, insecure default file perms in Memory tool) untouched β that one is pinned by@anthropic-ai/claude-agent-sdk@0.2.126and needs either an upstream SDK bump or anoverridesblock inpackage.json. Flagged for live review since it could affect SDK behavior.π€ Heartbeat agent β picked up from #46's "next time: investigate Dependabot alerts" / fixed in #49