chore(deps-dev): bump mariozechner to earendil-works - #314
Conversation
There was a problem hiding this comment.
Review mode: initial
Findings
-
[Minor]
src/main/agent/pi-model-resolution.ts:57– TheresolvePiRouteProtocolfunction forces'openai'for DeepSeek base URLs whenprovider === 'custom'even if the model ID does not appear to be a DeepSeek model. This could cause protocol mismatch if a user configures a custom provider with a DeepSeek endpoint but uses a non-DeepSeek model. Consider adding a stricter check. -
[Nit]
tests/deepseek-thinking-serialization.test.ts:8– The patch-presence check relies on a string search for'requiresThinkingInContent'in the compiled SDK output. If the patch is applied twice (causing duplicate diff text) or if the string appears in other comments, the check may produce a false positive. Consider verifying the actual exported symbol or behavior instead.
Summary
Review mode: initial
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
No blockers found. The PR correctly migrates from @mariozechner/pi-* to @earendil-works/pi-* (v0.81.1), updates imports, patches the new SDK for DeepSeek V4 thinking support, refactors ModelRuntime usage, and adds comprehensive DeepSeek URL/model resolution. Tests are updated and new tests cover DeepSeek-specific behavior. Residual risks include potential timing issues if external code calls getSharedAuthStorage() without await (all callers in this PR are properly updated), and fragility of the patch if the SDK receives minor updates. The changes are well-scoped and maintain backward compatibility for non-DeepSeek providers.
Testing
- Not run (automation)
Open Cowork Bot
8316018 to
fbe2fe6
Compare
There was a problem hiding this comment.
Findings
[Blocker] Compaction event name not updated in agent-runner.ts
- Evidence:
src/tests/agent/compact-integration.test.ts(lines 258, 310, 343) renames'auto_compaction_end'→'compaction_end', matching the new SDK. The diff forsrc/main/agent/agent-runner.tsshows no corresponding change to the event handler that listens for this event. The handler likely still uses the old event name, which will cause compaction results to never be surfaced asServerEvent. - Suggested fix: In
agent-runner.ts, update the event type filter from'auto_compaction_end'to'compaction_end'.
[Major] Builtin tools disabled without replacement
- Evidence:
src/main/agent/agent-runner.ts(lines increateAgentSessioncall) passesnoTools: 'builtin'andcustomTools: sdkCustomToolswheresdkCustomTools = [...wrappedTools, ...customTools]. The previous SDK supplied default builtins (e.g., TextEditor, Glob, Grep, WebFetch). By disabling all builtins and only providing the wrapped bash and MCP custom tools, those other builtin tools are lost. Functionality like text editing or file search will silently fail. - Suggested fix: Either remove
noTools: 'builtin'and override only the bash tool via the SDK's builtin replacement mechanism, or explicitly list all required builtins incustomTools.
[Minor] Inconsistent import path for pi-ai module
- Evidence:
src/main/agent/pi-model-resolution.tsimports from@earendil-works/pi-ai/compat, whilesrc/tests/agent/pi-model-resolution.test.tsimports from@earendil-works/pi-ai. If thecompatsubpath exports different types or API surface, this can cause type mismatches at test time. - Suggested fix: Align both imports to the same subpath. Since the source uses
compat, the test should also use@earendil-works/pi-ai/compat.
Summary
- Review mode: full review after prior context reset
- Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
- The PR upgrades the core AI SDK from
@mariozechner/pi-*to@earendil-works/pi-*and adds DeepSeek V4 routing and thinking support. Most import rewrites are correct, but two critical issues were found: an event name mismatch that will break compaction result surfacing, and a tool disabling strategy that loses builtin tools. These should be addressed before merging.
Testing
- Not run (automation).
- Existing tests for DeepSeek normalization and model resolution are present and pass with the new imports. No tests were added for the compaction event listener update or builtin tool availability.
Open Cowork Bot
9a5d023 to
cdbfd59
Compare
There was a problem hiding this comment.
Review mode: full review after prior context reset
Findings
No issues found. The migration from @mariozechner/pi-* v0.60.0 to @earendil-works/pi-* v0.81.1 is thorough and correctly adapted to the new SDK API surface:
- All imports updated consistently (including
/compatentry points where needed) AuthStorage→ModelRuntime(asynccreate()) with properawaiton all callerstools/customToolssplit tocustomTools+noTools: 'builtin'for the new SDKappendSystemPromptconverted from string to array ([coworkAppendPrompt])DefaultResourceLoadernow receivesagentDir: getAgentDir()resolvePiRouteProtocolsignature extended withbaseUrlandmodelparameters; all callers updated- DeepSeek V4 support added:
requiresThinkingInContentcompat flag,isDeepSeekBaseUrl, URL normalization to/v1, and proper routing to DeepSeek registry package-lock.jsonremoved from version control (added to.gitignore)@sinclair/typeboxadded as explicit dependency- Old patch removed, new patch for
@earendil-works/pi-aiwithrequiresThinkingInContentlogic - Test files updated with new import paths, DeepSeek test cases, and API changes
Residual risk: This is a major dependency upgrade. The PR assumes the new SDK is backward-compatible for the features used. No regressions or safety concerns were introduced in the diff.
Testing
Not run (automation) — but test updates look appropriate. Suggested manual validation:
- Run the app with various providers (Anthropic, OpenAI, DeepSeek) to verify session creation and tool execution
- Test subagent spawning (Coverage related)
- Verify DeepSeek V4 thinking serialization with the patch
- Run
npm run testandnpm run build
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Open Cowork Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings
-
[Major] Redundant and incorrect
npm install && npm ci --ignore-scriptsin CI (:.github/workflows/ci.yml:26)The new CI step runs
npm install(which executes thepostinstallscript – patching modules, downloading Node, rebuilding native modules) and then immediately runsnpm ci --ignore-scripts. Sincenpm cideletes the entirenode_modules/and reinstalls from the lockfile, all work done bynpm install– including patch-package, binary downloads, and native rebuilds – is discarded and then redone by the laternpx patch-packageandnpm rebuild better-sqlite3steps.This doubles installation time and adds unnecessary risk: the
postinstallscript could fail in CI (e.g., if a required binary download fails), yet its only purpose here is to generate a lockfile. Instead, generate the lockfile without running any scripts:- name: Generate lockfile (if missing) run: npm install --package-lock-only --ignore-scripts - name: Install dependencies run: npm ci --ignore-scripts
-
[Major] Non-deterministic installs due to lockfile removal (
:.gitignore:70)The PR removes
package-lock.jsonfrom version control (added to.gitignore). Without a committed lockfile,npm installresolves the latest semver-compatible versions at runtime, making each CI build potentially pull a different dependency tree. This makes bugs hard to reproduce and can introduce regressions without code changes. Consider either committing the lockfile or using a lockfile pinning strategy (e.g.,npm install --package-lock-onlyand committing the result).
Summary
Review mode: follow-up after new commits. The only new change since the last review is the CI workflow modification. The change introduces significant efficiency and reproducibility concerns. The simplified two-command install sequence is both wasteful (double install) and breaks the intended dependency isolation. The removal of the lockfile from version control further undermines deterministic builds.
Testing
Not run (automation) – suggested: verify the CI step completes with the corrected approach (npm install --package-lock-only --ignore-scripts then npm ci --ignore-scripts).
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Open Cowork Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings
-
[Major] Redundant and incorrect
npm install && npm ci --ignore-scriptsin CI (.github/workflows/ci.yml:26)The CI step runs
npm install(which executes thepostinstallscript – patching, downloading Node, rebuilding) and then immediately runsnpm ci --ignore-scripts. Sincenpm cideletes the entirenode_modules/and reinstalls from the lockfile, all work done bynpm installis discarded and then redone by the laternpx patch-packageandnpm rebuild better-sqlite3steps. This doubles installation time and adds unnecessary risk (e.g., postinstall failure can break the build).Suggested fix:
- name: Generate lockfile (if missing) run: npm install --package-lock-only --ignore-scripts - name: Install dependencies run: npm ci --ignore-scripts
-
[Major] Non-deterministic installs due to lockfile removal (
.gitignore:70,package-lock.jsonremoved)package-lock.jsonis added to.gitignoreand deleted from the repo. Without a committed lockfile,npm installresolves the latest semver-compatible versions at runtime, making each CI build potentially pull a different dependency tree. This makes bugs hard to reproduce and can introduce regressions without code changes.Suggested fix: commit the lockfile or use a lockfile pinning strategy (e.g.,
npm install --package-lock-onlyand committing the result). -
[Minor] Async migration risk:
getSharedAuthStorage()now returnsPromise<ModelRuntime>(src/main/agent/shared-auth.ts:14)The synchronous
AuthStorage.create()is replaced with asyncModelRuntime.create(). All callers updated in this PR (agent-runner.ts,sdk-one-shot.ts,subagent-extension.ts) correctly useawait. However, any other callers in the codebase (e.g., insrc/main/remote/orsrc/main/mcp/) that still use the old sync pattern (const auth = getSharedAuthStorage()) will break at runtime with a Promise object instead of an AuthStorage. A cross-repo audit of allgetSharedAuthStorageimport sites is needed.Suggested fix: audit all imports of
getSharedAuthStorageacross the repository and update any that are missingawait.
Questions
- None
Summary
Review mode: follow-up after new commits. The PR successfully updates the core AI SDK from @mariozechner to @earendil-works with comprehensive code and test changes. Two previously flagged issues (CI inefficiency and lockfile removal) remain unresolved. A new minor risk is identified: the async migration of getSharedAuthStorage() may break callers not updated in this PR. The rest of the SDK bump appears correct with adequate test coverage.
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Testing
Not run (automation) – tests are updated for the new SDK and DeepSeek V4 support. CI must be green before merge, but the current CI step has the redundancy issue noted above.
Open Cowork Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings
-
[Major] Non-deterministic installs due to lockfile removal (
.gitignore:71,package-lock.jsonremoved)package-lock.jsonis added to.gitignoreand deleted from the repo. Without a committed lockfile,npm installresolves the latest semver-compatible versions at runtime, making each CI build potentially pull a different dependency tree. This makes bugs hard to reproduce and can introduce regressions without code changes.Suggested fix: commit the lockfile or use a lockfile pinning strategy (e.g.,
npm install --package-lock-onlyand committing the result). -
[Minor] Async migration risk:
getSharedAuthStorage()now returnsPromise<ModelRuntime>(src/main/agent/shared-auth.ts:14)The synchronous
AuthStorage.create()is replaced with asyncModelRuntime.create(). All callers updated in this PR (agent-runner.ts,sdk-one-shot.ts,subagent-extension.ts) correctly useawait. However, any other callers in the codebase (e.g., insrc/main/remote/orsrc/main/mcp/) that still use the old sync pattern (const auth = getSharedAuthStorage()) will break at runtime with a Promise object instead of an AuthStorage. A cross-repo audit of allgetSharedAuthStorageimport sites is needed.Suggested fix: audit all imports of
getSharedAuthStorageacross the repository and update any that are missingawait. -
[Minor] CI cache disabled (
ci.yml:23)The
cache: npmline is commented out. This increases install time by ~30s per CI run. Consider re-enabling it or documenting why it's disabled.Suggested fix: uncomment the cache line or add a comment explaining the reason.
Fixed from previous review: The redundant npm install && npm ci --ignore-scripts in CI is now correctly simplified to npm ci --ignore-scripts.
Summary
Review mode: follow-up after new commits. The CI redundancy issue from the previous review is fixed. Two previously flagged issues (lockfile removal and async migration risk) remain unresolved. A new minor observation is the commented-out CI cache line. The rest of the SDK bump appears correct.
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Testing
Not run (automation) – previous tests are adequate. The CI step change is trivial.
Open Cowork Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings
-
[Major] Lockfile removal still breaks reproducible installs (
.gitignore:71,package-lock.jsondeleted)The
package-lock.jsonremains deleted and gitignored. The newly addednpm install --package-lock-only --ignore-scriptssteps generate a lockfile per CI run, but since it is not committed, different runs may pull different versions. This underminesnpm ci's deterministic guarantee. Local developers will also generate a different lockfile unless they happen to use the exact same registry state.Suggested fix: commit the generated lockfile, or use a dedicated lockfile pinning strategy (e.g.,
npm install --package-lock-onlyand committing the result). -
[Minor] Async migration risk still unresolved (
src/main/agent/shared-auth.ts:14)getSharedAuthStorage()returnsPromise<ModelRuntime>, but other callers outside this PR (e.g., insrc/main/remote/orsrc/main/mcp/) may still use the old sync pattern. This was flagged in the prior review and is not addressed in this follow-up diff.Suggested fix: audit all imports of
getSharedAuthStorageacross the repository and addawaitwhere missing. -
[Minor] CI npm cache still commented out (
.github/workflows/ci.yml:22-23)The
cache: npmline remains commented out. This increases install time by ~30s per CI run.Suggested fix: uncomment or document why caching is disabled.
-
[Minor] Release workflow Electron cache key broken by lockfile removal (
.github/workflows/release.yml:64,194)The Electron cache uses
hashFiles('package-lock.json')for its key, but this file is gitignored and not present in the checkout at the time the cache step runs (the lockfile is generated after the cache step).hashFileson a missing file returns an empty string, so the cache will always miss. This is a regression introduced by the lockfile removal.Suggested fix: generate the lockfile before the cache step, or (better) commit the lockfile.
Prior findings resolved: none. The prior review's findings remain open. The new Generate package lock steps mitigate per-build determinism but do not solve the root cause.
New import patch correctness: The patch for @earendil-works/pi-ai adds requiresThinkingInContent support for DeepSeek V4 models. The pattern is consistent with the prior patch and appears correct.
Source code changes: All import path updates and SDK API adjustments (e.g., appendSystemPrompt becomes array, noTools: 'builtin' added) are consistent with the @earendil-works/pi-coding-agent v0.81.1 API. The DeepSeek endpoint detection and model routing logic in pi-model-resolution.ts and auth-utils.ts is well-tested and correct.
Summary
Review mode: follow-up after new commits. No blocker findings. Four minor-to-major issues remain, three of which were carried over from the prior review. The new cache regression in the release workflow should be addressed before merging.
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Testing
Not run (automation). Existing tests cover new DeepSeek routing and model resolution. The CI/release changes are trivial and well-formed.
Open Cowork Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings (carried forward from prior review, still unresolved):
-
[Major] Lockfile removal breaks reproducible installs (
.gitignore:71,package-lock.jsondeleted)The
package-lock.jsonremains deleted and gitignored. Thenpm install --package-lock-only --ignore-scriptssteps generate a lockfile per CI run, but since it is not committed, different runs may pull different versions. This underminesnpm ci's deterministic guarantee. Local developers will also generate a different lockfile unless they happen to use the exact same registry state.Suggested fix: commit the generated lockfile, or use a dedicated lockfile pinning strategy (e.g.,
npm install --package-lock-onlyand committing the result). -
[Minor] CI npm cache still commented out (
.github/workflows/ci.yml:22-23)The
cache: npmline remains commented out. This increases install time by ~30s per CI run.Suggested fix: uncomment or document why caching is disabled.
-
[Minor] Release workflow Electron cache key broken by lockfile removal (
.github/workflows/release.yml:64,194)The Electron cache uses
hashFiles('package-lock.json')for its key, but this file is gitignored and not present in the checkout at the time the cache step runs (the lockfile is generated after the cache step).hashFileson a missing file returns an empty string, so the cache will always miss. This is a regression introduced by the lockfile removal.Suggested fix: generate the lockfile before the cache step, or (better) commit the lockfile.
Prior findings resolved:
- [Minor] Async migration risk – all callers within this PR (
agent-runner.ts,sdk-one-shot.ts) have been updated toawait getSharedAuthStorage(). No other callers are modified in this PR, so the risk of un-awaited calls outside the PR is not directly attributable to the current diff. Resolved within the scope of this PR.
New changes in this follow-up:
- Added
--no-audit --no-fundto allGenerate package locksteps (.github/workflows/ci.yml,.github/workflows/release.yml). This reduces network overhead and build noise. Change is correct and beneficial.
Summary
Review mode: follow-up after new commits. Three prior findings remain unresolved. One prior finding (async migration) is resolved within the scope of this PR. The new CI/release workflow tweaks are correct.
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Testing
Not run (automation). Existing tests cover the source code changes; workflow changes are configuration-only and well-formed.
Open Cowork Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings (re-verified from prior review, still unresolved):
-
[Major] Lockfile removal breaks reproducible installs (
.gitignore:71,package-lock.jsondeleted,.npmrc:8)The
package-lock.jsonremains deleted and gitignored. CI workflows generate a lockfile per run vianpm install --package-lock-only, but since it is not committed, different runs may pull different versions. This underminesnpm ci's deterministic guarantee and breaks the Electron cache key (see next finding).Suggested fix: commit the generated lockfile, or adopt a dedicated pinning strategy.
-
[Minor] CI npm cache still commented out (
.github/workflows/ci.yml:24)The
cache: npmline is still commented out in the CI workflow, increasing install time by ~30s per run.Suggested fix: uncomment or document why caching is disabled.
-
[Minor] Release workflow Electron cache key broken by lockfile removal (
.github/workflows/release.yml:63,193)The Electron cache uses
hashFiles('package-lock.json')for its key, but this file is gitignored and not present at checkout time (theGenerate package lockstep runs after the cache step).hashFileson a missing file returns an empty string, so the cache will always miss.Suggested fix: generate the lockfile before the cache step, or (better) commit the lockfile.
New changes in this follow-up:
- Node version bumped from
22to24.11.1in.nvmrc,.github/workflows/ci.yml,.github/workflows/deploy-website.yml, and.github/workflows/release.yml. This is a specific version pin, which improves reproducibility. No issues introduced.
Summary
Review mode: follow-up after new commits. Three prior findings remain unresolved. The new node version change is correct and does not introduce any additional issues.
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
Testing
Not run (automation).
Open Cowork Bot
9e4c8dc to
23d3782
Compare
There was a problem hiding this comment.
Review mode: full review after prior context reset
Findings
-
[Major]
.npmrcsetspackage-lock=falseand.gitignoreaddspackage-lock.json, removing the lockfile from version control. This prevents localnpm cifrom working (no lockfile present) and introduces risk of dependency drift across environments. Developers must manually runnpm install --package-lock-onlyor rely on CI-generated lockfiles, which may differ between platforms.
Suggested fix: Keeppackage-lock=trueand commit the lockfile, or document the new workflow explicitly in CONTRIBUTING.md with steps for local development. -
[Major]
subagent-extension.tsandagent-runner.tsnow passnoTools: 'builtin'and merge all tools (including bash wrappers) intocustomTools. This changes how the SDK registers built-in tools. If the new@earendil-works/pi-coding-agentdoes not supportnoToolsas a valid option, thecreateAgentSessioncall may throw or behave unexpectedly. The change from passingtools(old API) tocustomToolswith disabled builtins could break bash sudo interception and other built-in tool behaviors.
Suggested fix: Verify thatnoTools: 'builtin'is a supported option in the SDK version (0.81.1). If not, use the previous pattern of passing built-in tools viatoolsand custom tools viacustomTools. -
[Medium] CI workflows (
ci.yml,release.yml) comment outcache: npmand add a manual lockfile generation step. While not a bug, this will increase CI runtime by losing npm caching for all jobs.
Suggested fix: Re-enablecache: npmand keepcache-dependency-pathpointed at the generated lockfile, or use a deterministic lockfile path. -
[Medium] The
@sinclair/typeboxdependency is pinned to0.34.52directly independencies. If other transitive dependencies require a different version, this may cause duplication or conflicts in the module tree.
Suggested fix: Check the resolved version range in the generated lockfile; consider using^0.34.0to allow compatible updates unless a fixed version is explicitly required by the SDK. -
[Minor] PR title uses
chore(deps-dev):but the change includes production dependency swaps, new patches, and multiple source code modifications. The typechore(deps-dev)is misleading for changelog generation.
Suggested fix: Rename tofeat:orrefactor:as appropriate, e.g.,refactor: migrate from @mariozechner to @earendil-works SDK. -
[Minor] New test file
tests/codex-pr-review-context.test.tsis placed outside thesrc/tests/convention. While not a blocker, it diverges from the project standard.
Suggested fix: Move tosrc/tests/codex-pr-review-context.test.tsfor consistency.
Questions
- Does the new
@earendil-works/pi-coding-agent@0.81.1acceptnoTools: 'builtin'as a valid option increateAgentSession? The patch does not show SDK-side compatibility.
Summary
Review mode: full review after prior context reset
Review policy: advisory — the check reflects automation health/completion only; it does not approve the PR or resolve findings.
This PR performs a major dependency migration and lockfile policy change. The core SDK rename and DeepSeek routing enhancements appear correct, but three areas need attention: (1) the lockfile removal breaks local reproducibility and CI caching, (2) the noTools: 'builtin' approach may not be compatible with the new SDK, and (3) the PR type should be corrected. Test coverage for the new functions (isLinearReviewUpdate, isDeepSeekBaseUrl) looks adequate.
Testing
Suggested tests (in addition to existing):
- Integration test that verifies
createAgentSessionworks withnoTools: 'builtin'and all custom tools (bash + MCP). - Regression test that confirms bash sudo password prompt still works after the tool merge.
Open Cowork Bot
Summary
Type of change
fix)feat)refactor/perf)docs)test)build/ci)Checklist
feat:,fix:, etc.)npm run testpasses locallynpm run lintpasses locallyen+zh)Testing
Screenshots / recordings (if applicable)