Conversation
|
Greptile SummaryFixed the evals CLI build process to properly link the binary and preserve user configuration defaults after the build migration. The PR adds three key fixes:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 107f640 |
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 3/5
- Some regression risk due to a medium-severity config handling change that can silently drop defaults for existing users.
packages/evals/scripts/build-cli.tsreplaces the entiredefaultsobject, which may ignore newly added default keys in source config after prior builds.- Pay close attention to
packages/evals/scripts/build-cli.ts- ensure defaults are merged rather than replaced to avoid losing new default entries.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/evals/scripts/build-cli.ts">
<violation number="1" location="packages/evals/scripts/build-cli.ts:48">
P2: Replacing the entire `defaults` object instead of merging it will silently drop any new default keys added to the source config for users who have built before. Use a shallow merge so user overrides are preserved while new source defaults are still picked up.</violation>
</file>
Architecture diagram
sequenceDiagram
participant Dev as Developer / User
participant Build as build-cli.ts
participant FS as Local File System
participant NPM as npm Registry (Global)
participant CLI as evals CLI (dist)
participant Engine as Stagehand Engine
Note over Dev, NPM: Build & Link Phase (pnpm build:cli)
Dev->>Build: Execute build script
Build->>FS: Read packages/evals/evals.config.json
FS-->>Build: Source config data
opt NEW: If existing config exists in dist/
Build->>FS: Read dist/cli/evals.config.json
FS-->>Build: Existing dist config
Build->>Build: NEW: Preserve 'defaults' from dist config
end
Build->>Build: Merge tasks/benchmarks from source
Build->>FS: NEW: Write merged config to dist/
Build->>FS: Set executable permissions (chmod 755)
Build->>NPM: NEW: npm link --force
alt Link Success
NPM-->>Build: Linked 'evals' binary globally
else Link Failure
Build-->>Dev: Console Warning (non-fatal)
end
Note over Dev, Engine: Execution Phase
Dev->>CLI: Run 'evals' command
CLI->>Engine: initV3() initialization
Engine->>Engine: CHANGED: Set serverCache: false
Engine->>Engine: Initialize evaluation suite
Engine-->>Dev: Evaluation results
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
why
After the build migration,
pnpm build:cliwas no longer linking or preserving overriden configswhat changed
package.jsonto enable npm linkingpnpm build:cliserverCache: falsein initV3 for consistent eval behavior on APItest plan