feat(agent): add dev/prod deploy targets and runtime switch - #20
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR introduces dev/prod agent targeting for the Octavus integration. A new 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@package.json`:
- Around line 11-12: The start:prod and dev npm scripts use POSIX-style
environment variable syntax (AGENT_TARGET=value) which is not compatible with
Windows cmd.exe or PowerShell. Install cross-env as a dev dependency with
version ^7.0.3 in the devDependencies section of package.json, then wrap the
environment variable assignments in both the start:prod and dev scripts by
prefixing them with cross-env, so that AGENT_TARGET=prod becomes cross-env
AGENT_TARGET=prod and AGENT_TARGET=dev becomes cross-env AGENT_TARGET=dev,
ensuring the scripts work cross-platform on both Unix-like systems and Windows.
In `@server.js`:
- Around line 34-38: The AGENT_TARGET variable assignment accepts any non-'prod'
value as 'dev', which means typos or invalid values will silently fallback to
the dev configuration. Add validation after the AGENT_TARGET assignment to check
that it is either 'prod' or 'dev', and throw an error if an invalid value is
provided. This ensures that configuration mistakes are caught explicitly rather
than silently defaulting to an unintended environment.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5095cb2d-0dca-414e-90e0-6324d1e85093
📒 Files selected for processing (6)
.env.example.gitignoreREADME.mdpackage.jsonscripts/deploy-agent.mjsserver.js
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Prevents local agent experiments from leaking into the production Cosmo agent by separating dev and prod at two layers, while staying fully backward compatible with existing
.envfiles.scripts/deploy-agent.mjsstages a copy ofagents/cosmo-tutor/and rewrites only theslug/namefor the target beforeoctavus validate+sync. The prompts andprotocol.yamlremain a single source of truth, so dev (cosmo-tutor-dev) and prod (cosmo-tutor) can never drift. Prod requires explicit confirmation (interactive prompt, or--yesfor CI).AGENT_TARGET(OCTAVUS_AGENT_ID_DEV/OCTAVUS_AGENT_ID_PROD).deploy:agent:dev,deploy:agent:prod,validate:agent;npm run devnow targets the dev agent..env.example(placeholders only, no secrets).Backward compatibility
AGENT_TARGETdefaults toprod.OCTAVUS_AGENT_ID..envthat only definesOCTAVUS_AGENT_IDkeeps talking to its production agent with no changes required.Changes
scripts/deploy-agent.mjs— slug-rewrite deploy with prod confirmation guardserver.js—AGENT_TARGETswitch with legacy fallback (default prod)package.json—deploy:agent:dev|prod,validate:agent, dev targets dev.gitignore— ignore.agent-build/.env.example,README.md— documentationTest plan
npm test— 66/66 passnpm run deploy:agent:devsyncs tocosmo-tutor-devdeploy:agent:prodrefuses without confirmationMade with Cursor