fix(core): deep merge workflow metadata - #696
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThis PR changes ContextManager to deep-merge incoming metadata via a new mergeMetadata helper, tightens updateMetadata input validation to require plain objects, adds tests verifying nested metadata preservation across successive updates, and regenerates the install manifest. ChangesMetadata Deep Merge Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Coverage ReportCoverage report not available
Generated by PR Automation (Story 6.1) |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.aiox-core/core/orchestration/context-manager.js (1)
19-19: ⚡ Quick winUse absolute import instead of relative import
require('../config/merge-utils')breaks the repository import convention for JS/TS files. Please switch this to the project’s absolute import style used in this codebase.As per coding guidelines,
**/*.{js,jsx,ts,tsx}: Use absolute imports instead of relative imports in all code.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.aiox-core/core/orchestration/context-manager.js at line 19, The require call using a relative path for isPlainObject breaks the repo's import convention; replace require('../config/merge-utils') with the project's absolute import of the same module (keeping the isPlainObject symbol) so the file .aiox-core/core/orchestration/context-manager.js uses the codebase's absolute import style (i.e., require or import from the repo root/module alias used elsewhere) and verify the import still exposes isPlainObject.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.aiox-core/core/orchestration/context-manager.js:
- Around line 245-247: The public method updateMetadata currently passes any
value to mergeMetadata which silently ignores non-object inputs; add an explicit
guard at the start of updateMetadata to validate that the incoming metadata is a
plain object (e.g., typeof metadata === 'object' && metadata !== null &&
!Array.isArray(metadata'') && metadata.constructor === Object or use the repo's
isPlainObject utility if available). If validation fails, throw a TypeError with
clear context (e.g., "updateMetadata expects a plain object, received:
<type/value>") so callers fail fast; otherwise proceed to call loadState() and
mergeMetadata(state.metadata, metadata) as before.
---
Nitpick comments:
In @.aiox-core/core/orchestration/context-manager.js:
- Line 19: The require call using a relative path for isPlainObject breaks the
repo's import convention; replace require('../config/merge-utils') with the
project's absolute import of the same module (keeping the isPlainObject symbol)
so the file .aiox-core/core/orchestration/context-manager.js uses the codebase's
absolute import style (i.e., require or import from the repo root/module alias
used elsewhere) and verify the import still exposes isPlainObject.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5c900b40-bc4a-4ed6-a351-d8433e085aeb
📒 Files selected for processing (3)
.aiox-core/core/orchestration/context-manager.js.aiox-core/install-manifest.yamltests/core/orchestration/context-manager.test.js
cb52030 to
dbae2c6
Compare
Summary
ContextManager.updateMetadata()preserve nested metadata instead of overwriting whole subtreesnullas an explicit metadata valueFixes part of #621.
Validation
Notes
Summary by CodeRabbit