Rename relay state directory to .agentworkforce/relay#1028
Conversation
Move Relay's on-disk footprint from `.agent-relay` to `.agentworkforce/relay`: - Project-local data dir: `.agent-relay/` -> `.agentworkforce/relay/` - Global home dir: `~/.agent-relay` -> `~/.agentworkforce/relay` - XDG/platform data dirs (`$XDG_DATA_HOME`, Application Support, APPDATA, `.local/share`) and broker log dirs (Library/Logs, XDG_STATE) move under `agentworkforce/relay` - `.git/info/exclude` and ignore files now scope `.agentworkforce/relay/`, leaving tracked `.agentworkforce/trajectories/` untouched Left unchanged: the `~/.config/agent-relay` config dir, the `agent-relay` binary/package/MCP names, the `.agent-relay.json` legacy config file, and `--state-dir` example values. Hard switch with no migration of old paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR renames the Agent Relay directory structure from ChangesAgent Relay Directory Structure Rename
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be1f0dc5ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .pytest_cache/ | ||
|
|
||
| .agent-relay/ | ||
| .agentworkforce/relay/ |
There was a problem hiding this comment.
Ignore nested runtime state directories
When Relay is started from a package/subproject inside a monorepo, findProjectRoot() can choose that subdirectory because it contains its own package.json, so state is created at packages/foo/.agentworkforce/relay. This new ignore pattern contains a slash, so Git only ignores the root .agentworkforce/relay/ path; the old .agent-relay/ pattern matched directories at any depth. Because ensureGitExclude() also only writes an exclude when the chosen project root has its own .git, nested state files can now show up as untracked files in the outer repo.
Useful? React with 👍 / 👎.
|
CodeAnt AI finished reviewing your PR. |
|
✅ pr-reviewer applied fixes — committed and pushed Reviewed PR #1028 against the diff and changed files. I did not find code breakage requiring edits. Local verification:
Rust tests could not be run because no |
Now that the state directory is renamed with no migration, remove the legacy-only file paths instead of carrying them forward: - Delete the unused `getGlobalPaths()` and `listProjects()` exports plus their `GLOBAL_BASE_DIR` / `getGlobalBaseDir()` backing — these only ever scanned the pre-project-local global storage location and have no callers. - Drop the `.agent-relay.json` project-root config fallback in shadow-config; configuration now loads solely from `.agentworkforce/relay/config.json`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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 `@packages/utils/src/update-checker.test.ts`:
- Around line 162-166: The test's substring assertion is fragile on Windows
because expectedFile is created with path.join (so separators vary); update the
assertion to compare against a path.join-built suffix instead of a hardcoded
forward-slash string. Specifically, use the existing expectedDir or build a
suffix with path.join('.agentworkforce', 'relay') and assert expectedFile
contains that value (referencing the variables expectedFile and expectedDir in
update-checker.test.ts) so the test is platform-agnostic.
🪄 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: 67912a4c-a24a-4247-b411-f93d6e86b965
📒 Files selected for processing (52)
.gitignore.npmignoreCHANGELOG.mdTELEMETRY.mdcrates/broker/src/cli/mod.rscrates/broker/src/runtime/connection.rscrates/broker/src/runtime/init.rscrates/broker/src/runtime/paths.rscrates/broker/src/runtime/tests.rscrates/broker/src/runtime/util.rscrates/broker/src/telemetry.rscrates/broker/tests/continuity.rsinstall.shpackages/cli/src/cli/commands/core.test.tspackages/cli/src/cli/commands/core.tspackages/cli/src/cli/commands/doctor.test.tspackages/cli/src/cli/commands/local-agent.tspackages/cli/src/cli/lib/attach-drive.test.tspackages/cli/src/cli/lib/attach-passthrough.test.tspackages/cli/src/cli/lib/attach-view.test.tspackages/cli/src/cli/lib/attach-view.tspackages/cli/src/cli/lib/attach.tspackages/cli/src/cli/lib/broker-connection.test.tspackages/cli/src/cli/lib/broker-connection.tspackages/cli/src/cli/lib/broker-lifecycle.tspackages/cli/src/cli/lib/core-maintenance.tspackages/cli/src/cli/lib/project-broker-client.test.tspackages/cli/src/cli/lib/project-broker-client.tspackages/cli/src/cli/lib/workspace-store.tspackages/cli/src/cost/tracker.tspackages/cloud/src/audit.tspackages/cloud/src/types.tspackages/config/src/bridge-config.tspackages/config/src/project-namespace.tspackages/config/src/relay-file-writer.tspackages/config/src/shadow-config.tspackages/config/src/teams-config.tspackages/harness-driver/src/client.tspackages/sdk/.gitignorepackages/telemetry/src/config.tspackages/telemetry/src/machine-id.tspackages/utils/src/discovery.tspackages/utils/src/relay-pty-path.test.tspackages/utils/src/relay-pty-path.tspackages/utils/src/update-checker.test.tspackages/utils/src/update-checker.tsscripts/e2e-test.shscripts/test-spawn-refactor.shtests/integration/broker/continuity.test.tstests/integration/broker/lockfile.test.tsweb/app/telemetry/page.tsxweb/content/docs/cli-broker-lifecycle.mdx
| const expectedDir = path.join(os.homedir(), '.agentworkforce/relay'); | ||
| const expectedFile = path.join(expectedDir, 'update-cache.json'); | ||
|
|
||
| // We can verify the path structure is correct | ||
| expect(expectedFile).toContain('.agent-relay'); | ||
| expect(expectedFile).toContain('.agentworkforce/relay'); |
There was a problem hiding this comment.
Windows-fragile substring assertion.
expectedFile is built with path.join, which normalizes / to \ on win32, so the result contains .agentworkforce\relay and toContain('.agentworkforce/relay') fails there. The previous .agent-relay literal had no separator, so it was platform-agnostic. Assert against a path.join-built suffix instead of a hardcoded forward-slash substring.
💚 Proposed fix
- // We can verify the path structure is correct
- expect(expectedFile).toContain('.agentworkforce/relay');
+ // We can verify the path structure is correct
+ expect(expectedFile).toContain(path.join('.agentworkforce', 'relay'));
expect(expectedFile).toContain('update-cache.json');📝 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.
| const expectedDir = path.join(os.homedir(), '.agentworkforce/relay'); | |
| const expectedFile = path.join(expectedDir, 'update-cache.json'); | |
| // We can verify the path structure is correct | |
| expect(expectedFile).toContain('.agent-relay'); | |
| expect(expectedFile).toContain('.agentworkforce/relay'); | |
| const expectedDir = path.join(os.homedir(), '.agentworkforce/relay'); | |
| const expectedFile = path.join(expectedDir, 'update-cache.json'); | |
| // We can verify the path structure is correct | |
| expect(expectedFile).toContain(path.join('.agentworkforce', 'relay')); | |
| expect(expectedFile).toContain('update-cache.json'); |
🤖 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 `@packages/utils/src/update-checker.test.ts` around lines 162 - 166, The test's
substring assertion is fragile on Windows because expectedFile is created with
path.join (so separators vary); update the assertion to compare against a
path.join-built suffix instead of a hardcoded forward-slash string.
Specifically, use the existing expectedDir or build a suffix with
path.join('.agentworkforce', 'relay') and assert expectedFile contains that
value (referencing the variables expectedFile and expectedDir in
update-checker.test.ts) so the test is platform-agnostic.
|
✅ pr-reviewer applied fixes — committed and pushed Reviewed and fixed PR #1028 locally. Changed:
Verified locally:
Could not run Rust tests because |
…fallback - RelayFileWriter no longer creates the `/tmp/relay-outbox/<agent>` compat symlink: drop `LEGACY_OUTBOX_BASE`, `RelayPaths.legacyOutboxDir`, `getLegacyOutboxPath()`, `setupWorkspaceSymlinks()`, and the now-unused `createSymlinkSafe()` helper. `ensureDirectories()` just creates the canonical outbox/attachments/meta dirs. - Drop the legacy `~/.agent-relay/dashboard` static-asset fallback from broker startup (`resolveDashboardStaticDir`); only `~/.relay/dashboard` is read, matching the installer (install.sh writes UI assets to ~/.relay/dashboard). Remove the contradicting "renamed installer dashboard layout" test, which asserted resolution of a path the installer never creates. The uninstaller's best-effort cleanup of legacy install dirs (INSTALL_DIR_NAMES) is kept — naming the old dir is useful at removal time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 56 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".agentworkforce/trajectories/completed/2026-06/traj_4md0a6r9hjtd/trajectory.json">
<violation number="1" location=".agentworkforce/trajectories/completed/2026-06/traj_4md0a6r9hjtd/trajectory.json:28">
P2: Decision event `content` field has duplicated text — the same phrase appears both before and after the colon separator</violation>
</file>
Note: This PR contains a large number of files. Free-tier reviews are limited to 40 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review. Paid plans can review more files.
Re-trigger cubic
| { | ||
| "ts": 1780465199849, | ||
| "type": "decision", | ||
| "content": "Kept uninstall cleanup for legacy ~/.agent-relay installer artifacts: Kept uninstall cleanup for legacy ~/.agent-relay installer artifacts", |
There was a problem hiding this comment.
P2: Decision event content field has duplicated text — the same phrase appears both before and after the colon separator
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .agentworkforce/trajectories/completed/2026-06/traj_4md0a6r9hjtd/trajectory.json, line 28:
<comment>Decision event `content` field has duplicated text — the same phrase appears both before and after the colon separator</comment>
<file context>
@@ -0,0 +1,53 @@
+ {
+ "ts": 1780465199849,
+ "type": "decision",
+ "content": "Kept uninstall cleanup for legacy ~/.agent-relay installer artifacts: Kept uninstall cleanup for legacy ~/.agent-relay installer artifacts",
+ "raw": {
+ "question": "Kept uninstall cleanup for legacy ~/.agent-relay installer artifacts",
</file context>
User description
Summary
Renames Relay's on-disk state directory from
.agent-relayto.agentworkforce/relayacross the Rust broker, TypeScript packages, tests, and current docs.Directories changed:
.agent-relay/→.agentworkforce/relay/~/.agent-relay→~/.agentworkforce/relay$XDG_DATA_HOME/agent-relay,~/Library/Application Support/agent-relay,%APPDATA%\agent-relay,~/.local/share/agent-relay→agentworkforce/relay~/Library/Logs/agent-relay,$XDG_STATE_HOME/agent-relay/logs→agentworkforce/relay.git/info/excludeauto-entry +.gitignore/.npmignorenow scope.agentworkforce/relay/, leaving tracked.agentworkforce/trajectories/untouchedDeliberately left unchanged:
~/.config/agent-relayconfig dir (relay.json, trajectories, policies) — a separate config namespace, outside the agreed data/home scopeagent-relaybinary /@agent-relay/*package / MCP server names.agent-relay.jsonlegacy shadow-config file (not the dir)--state-diris a user-supplied path; example value updated to.agentworkforce/relay-stagingfor doc consistency onlyCompatibility: Hard switch — existing brokers/state under the old paths are not migrated. See Migration Guidance in the changelog.
Validation
cargo check --bin agent-relay-broker --tests✅cargo test -p agent-relay-broker runtime::→ 141 passed (incl.broker_log_dir_uses_platform_standard_layout) ✅cargo test -p agent-relay-broker --test continuity→ 12 passed ✅npm run typecheck(package chain + CLItsc --noEmit) ✅Notes
.claude/skills/and.agents/skills/and the frozenweb/content/docs/7.1.1/snapshot were left out of scope.🤖 Generated with Claude Code
CodeAnt-AI Description
Move Relay runtime files to
.agentworkforce/relayWhat Changed
.agentworkforce/relay/instead of.agent-relay/~/.agentworkforce/relay/and matching platform data locationsconnection.jsonin the new location and show updated path guidance in error messages and help text~/.config/agent-relayunchangedImpact
✅ New installs use the same runtime path across CLI, broker, and telemetry✅ Fewer path mismatches when attaching to a running broker✅ Clearer upgrade guidance for users moving from .agent-relay💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.