Remove personas from @agent-relay/sdk#1002
Conversation
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThis PR removes the SDK persona subsystem: deletes persona module and tests/examples, removes persona-related exports and AgentRelay APIs/options, drops the persona-kit dependency, updates the build to delete stale persona artifacts before packing, and updates changelog/docs and a completed trajectory record. ChangesSDK Persona API Removal
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Code Review
This pull request removes persona support from the @agent-relay/sdk package, including the ./personas subpath, persona helper/type exports, AgentRelay.spawnPersona(), AgentRelay.getPersonaSpawnPlan(), and AgentRelayOptions.personaDirs. It also removes the dependency on @agentworkforce/persona-kit, deletes associated tests and examples, and updates the migration documentation. Feedback on the changes suggests cleaning the entire dist directory during the build step instead of targeting specific stale persona artifacts to ensure a more robust build process.
| "scripts": { | ||
| "prebuild": "npm --prefix ../github-primitive run build && npm --prefix ../slack-primitive run build && npm --prefix ../config run build && npm --prefix ../cloud run build", | ||
| "build": "npx tsc -p tsconfig.build.json", | ||
| "build": "node -e \"const fs=require('fs');for(const f of ['dist/personas.js','dist/personas.js.map','dist/personas.d.ts','dist/personas.d.ts.map'])fs.rmSync(f,{force:true})\" && npx tsc -p tsconfig.build.json", |
There was a problem hiding this comment.
Instead of targeting and deleting only the specific stale personas build artifacts, it is generally safer and more robust to clean the entire dist directory before running the TypeScript compiler. This prevents any other stale, renamed, or deleted files from persisting in the build output and potentially being packaged/published.
We can simplify the command by recursively removing the dist directory using Node's built-in fs.rmSync.
| "build": "node -e \"const fs=require('fs');for(const f of ['dist/personas.js','dist/personas.js.map','dist/personas.d.ts','dist/personas.d.ts.map'])fs.rmSync(f,{force:true})\" && npx tsc -p tsconfig.build.json", | |
| "build": "node -e \"require('fs').rmSync('dist', {recursive: true, force: true})\" && npx tsc -p tsconfig.build.json", |
|
Preview deployed!
This preview will be cleaned up when the PR is merged or closed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
@.agentworkforce/trajectories/completed/2026-05/traj_kbxzde45cjlw/trajectory.json:
- Line 63: The committed trajectory.json contains a local absolute path in the
"projectId" field which leaks developer environment data; update the "projectId"
key value to a repo-stable identifier (e.g., a project slug, UUID, or remove the
key entirely) instead of "/Users/will/Projects/AgentWorkforce/relay" so the file
contains no user-specific filesystem paths; ensure any consumers of projectId
(e.g., code that reads trajectory metadata) still handle the new identifier or
absence of the field.
🪄 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 Plus
Run ID: cffc9f95-1b4b-411c-b84d-018722338f86
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
.agentworkforce/trajectories/completed/2026-05/traj_kbxzde45cjlw/summary.md.agentworkforce/trajectories/completed/2026-05/traj_kbxzde45cjlw/trajectory.jsonCHANGELOG.mdpackages/sdk/package.jsonpackages/sdk/src/__tests__/personas.test.tspackages/sdk/src/examples/persona-spawn.tspackages/sdk/src/index.tspackages/sdk/src/personas.tspackages/sdk/src/relay.tsweb/content/docs/event-handlers.mdx
💤 Files with no reviewable changes (5)
- packages/sdk/src/examples/persona-spawn.ts
- packages/sdk/src/index.ts
- packages/sdk/src/personas.ts
- packages/sdk/src/relay.ts
- packages/sdk/src/tests/personas.test.ts
| }, | ||
| "commits": ["6a456b7f"], | ||
| "filesChanged": [], | ||
| "projectId": "/Users/will/Projects/AgentWorkforce/relay", |
There was a problem hiding this comment.
Remove absolute local path from committed trajectory metadata.
projectId currently leaks a developer-local filesystem path (/Users/will/...). Replace it with a repo-stable identifier (or omit it) to avoid exposing local user/environment details in version control.
Suggested fix
- "projectId": "/Users/will/Projects/AgentWorkforce/relay",
+ "projectId": "agentworkforce/relay",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "projectId": "/Users/will/Projects/AgentWorkforce/relay", | |
| "projectId": "agentworkforce/relay", |
🤖 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
@.agentworkforce/trajectories/completed/2026-05/traj_kbxzde45cjlw/trajectory.json
at line 63, The committed trajectory.json contains a local absolute path in the
"projectId" field which leaks developer environment data; update the "projectId"
key value to a repo-stable identifier (e.g., a project slug, UUID, or remove the
key entirely) instead of "/Users/will/Projects/AgentWorkforce/relay" so the file
contains no user-specific filesystem paths; ensure any consumers of projectId
(e.g., code that reads trajectory metadata) still handle the new identifier or
absence of the field.
Summary
@agentworkforce/persona-kitfrom@agent-relay/sdkand the lockfiledist/personas.*artifactsFixes #997
Verification
npm --prefix packages/sdk run checknpm --prefix packages/sdk run buildRELAY_API_KEY=test npx vitest run --config /private/tmp/vitest-sdk.config.mjs packages/sdk/src/__tests__/harness.test.ts packages/sdk/src/__tests__/lifecycle-hooks.test.ts packages/sdk/src/__tests__/orchestration-upgrades.test.tsnpm pack --dry-run --workspace @agent-relay/sdk --ignore-scriptsNote:
npm --prefix packages/sdk testcurrently fails before running tests because the script looks fordist/__tests__/integration.test.js, but the SDK build excludes tests.