Repository navigation
fix(daemon): reject a non-map agent spec profile instead of crashing normalize - #1320
Conversation
…normalize Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Thanks, @rudycelekli. You found a bare profile key ( One change, please: switch to the alternative you offered. Drop the new check in A few small test cases are enough: a bare key, When you've pushed it and marked the PR ready, we'll review the change. |
Drop the new validateAgentSpec check. A bare `default:` (null) is now
normalized like `default: {}`; scalar and list profiles keep main's
existing handling.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Switched to the alternative in 70b98e8. The new validateAgentSpec check is gone (that function is back to main's). normalizeAgentSpec now passes agent-spec-null-profile.test.ts now covers a bare key, |
openrig-review
left a comment
There was a problem hiding this comment.
Approved at 70b98e8. A bare profile key (profiles: default: with nothing after it) now normalizes as an empty profile, the same as default: {}, instead of crashing when the agent is resolved or bundled. Validation is unchanged, and scalar and list profiles keep main's handling. Required CI passed at this head, and no main commit has touched its files since its base.
— dev60-planner@v-openrig-build
|
Thanks, @rudycelekli; #1320 is merged. A bare profile key in an agent spec ( |
What a user gets
Before: an agent spec with a bare profile key
validated as
valid: trueand thennormalizeAgentSpecthrewTypeError: Cannot read properties of null (reading 'uses'), so the failure surfaced later, at import or launch, instead of in validation. After:validateAgentSpecreportsprofiles.default: must be a map (an empty profile is {}).default: {}still validates and normalizes.How you verified it
Tested at upstream
main(fetched and rebased) plus this change, Node 22,npm ci --ignore-scripts -w packages/daemon.New
packages/daemon/test/agent-spec-null-profile.test.ts(5 cases: bare key, scalar, empty list, plain string, and the accepted{}):Also: all 19 shipped
agent.yamlspecs still validate (invalid: 0 of 19); the 42 daemon test files matchingagent|pod|profile: 612 passed, 2 failed. The 2 failures are inpod-bundle-assembler.test.ts("keeps in-root symlinks with a symlinked rig root") and fail identically on unmodifiedmainin my environment.tsc --noEmit -p packages/daemon/tsconfig.jsonclean.Not run:
npm run build/lintfor the other packages, the fullnpm test, a live import/launch.Anything you were unsure about
I chose to reject a non-map profile rather than treat
default:as an empty profile: a null profile could never normalize, so no working spec can contain one, but this also now rejects a scalar or list profile (default: 5), which previously slipped through as an empty profile. If you would rather accept a bare key as{}, that is a two-line change innormalizeAgentSpecinstead; happy to switch.The new guard sits in the existing profile loop, wrapped in a bare block to keep the diff small rather than re-indenting the body.
One concern per PR; no version bump; no
CHANGELOG.mdeditTests added or updated where the change is testable
I listed the checks I ran, their results, and any checks I could not run
(Checkboxes left for the author to tick.)
🤖 Generated with Claude Code
Summary by CodeRabbit
default:profiles now validate and normalize the same way as empty profiles. Existing profile content and other profile values retain their expected behavior.