Skip to content

Remove personas from @agent-relay/sdk#1002

Merged
willwashburn merged 3 commits into
mainfrom
codex/remove-personas-sdk
May 27, 2026
Merged

Remove personas from @agent-relay/sdk#1002
willwashburn merged 3 commits into
mainfrom
codex/remove-personas-sdk

Conversation

@willwashburn
Copy link
Copy Markdown
Member

Summary

  • remove SDK persona loading, spawn, dry-run, tests, example, and public exports
  • drop @agentworkforce/persona-kit from @agent-relay/sdk and the lockfile
  • update migration notes/docs and ensure SDK builds remove stale dist/personas.* artifacts

Fixes #997

Verification

  • npm --prefix packages/sdk run check
  • npm --prefix packages/sdk run build
  • RELAY_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.ts
  • npm pack --dry-run --workspace @agent-relay/sdk --ignore-scripts

Note: npm --prefix packages/sdk test currently fails before running tests because the script looks for dist/__tests__/integration.test.js, but the SDK build excludes tests.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Review Change Stack

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This 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.

Changes

SDK Persona API Removal

Layer / File(s) Summary
SDK public surface updates
packages/sdk/src/index.ts, packages/sdk/package.json
Removes ./personas re-export and ./personas package export; adds github and slack integration exports to the SDK public surface.
AgentRelay persona API removal
packages/sdk/src/relay.ts
Deletes persona imports, removes SpawnPersonaOptions type, removes AgentRelayOptions.personaDirs, removes internal defaultPersonaDirs and constructor wiring, and removes spawnPersona() and getPersonaSpawnPlan() methods.
Build script and dependency cleanup
packages/sdk/package.json
Removes @agentworkforce/persona-kit from dependencies and changes build script to delete dist/personas.* artifacts (JS, source maps, and d.ts) before running tsc.
Tests, examples, and docs updates
packages/sdk/src/__tests__/*, packages/sdk/src/examples/*, web/content/docs/event-handlers.mdx, .agentworkforce/trajectories/.../*, CHANGELOG.md
Deletes persona tests and example; updates migration/docs to use spawnPty(...) per-call callbacks and consolidated breaking-change/migration guidance; adds trajectory summary and JSON recording the completed work and decisions.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • AgentWorkforce/relay#973: Related work that rewired persona APIs to use @agentworkforce/persona-kit, touching the same persona surface this PR removes.
  • AgentWorkforce/relay#818: Previously added the SDK personas subsystem (src/personas.ts, AgentRelay.spawnPersona()), which this PR reverses.

Suggested reviewers

  • khaliqgant

Poem

🐰 Personas hopped out the SDK gate,
CLI commands now shape their fate.
Builds sweep crumbs from dist and pack,
Tests and examples fade to black.
A rabbit cheers the tidy state.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main objective of the PR: removing persona support from the @agent-relay/sdk package.
Description check ✅ Passed The PR description follows the template with clear summary and verification sections; it documents what was removed and testing steps, though manual testing completion checkbox is not explicitly marked.
Linked Issues check ✅ Passed The PR comprehensively addresses all five required scope items from issue #997: removes personas.ts file and SDK exports, deletes spawnPersona/getPersonaSpawnPlan methods, drops @agentworkforce/persona-kit dependency, and updates migration documentation.
Out of Scope Changes check ✅ Passed All changes are directly aligned with removing persona support from the SDK. The updates to CHANGELOG.md, index.ts, relay.ts, package.json, and documentation all support the core objective with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/remove-personas-sdk

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/sdk/package.json
"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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
"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",

@github-actions
Copy link
Copy Markdown
Contributor

Preview deployed!

Environment URL
Web https://d3ioqti2b2pxc6.cloudfront.net

This preview will be cleaned up when the PR is merged or closed.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6a456b7 and c5b52ae.

⛔ Files ignored due to path filters (1)
  • package-lock.json is 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.json
  • CHANGELOG.md
  • packages/sdk/package.json
  • packages/sdk/src/__tests__/personas.test.ts
  • packages/sdk/src/examples/persona-spawn.ts
  • packages/sdk/src/index.ts
  • packages/sdk/src/personas.ts
  • packages/sdk/src/relay.ts
  • web/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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
"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.

@willwashburn willwashburn merged commit f904124 into main May 27, 2026
45 checks passed
@willwashburn willwashburn deleted the codex/remove-personas-sdk branch May 27, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove personas from @agent-relay/sdk

1 participant