-
Notifications
You must be signed in to change notification settings - Fork 60
fix(cli): resolve the broker workspace through one precedence ladder #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,42 @@ agent-relay node agent release <name> | |||||||||
|
|
||||||||||
| For AI SDK native harnesses, attach renders structured activity, text, tools, approvals, files, usage, and lifecycle events. Add `--json` for NDJSON, `--reasoning` for reasoning events, or `--diagnostics` for sidecar diagnostics. Native harness `drive` is line-oriented and acknowledged; native harness `passthrough` is unsupported because no terminal stream exists. PTY attach behavior is unchanged. | ||||||||||
|
|
||||||||||
| ### Which workspace a broker joins | ||||||||||
|
|
||||||||||
| `agent-relay up` and `agent-relay node up` resolve the workspace through one | ||||||||||
| precedence ladder. The first source that resolves wins: | ||||||||||
|
|
||||||||||
| | # | Source | Where it comes from | | ||||||||||
| | --- | ------------------------------- | ----------------------------------------------------------------------------- | | ||||||||||
| | 1 | Command-line flag | `--workspace-key` / `--wk` | | ||||||||||
| | 2 | Environment | `RELAY_WORKSPACE_KEY`, then `AGENT_RELAY_WORKSPACE_KEY`, then `RELAY_API_KEY` | | ||||||||||
| | 3 | Repository pin | `<project>/.agentworkforce/relay/workspace-key.json` | | ||||||||||
| | 4 | Machine-global active workspace | the `active` entry in `~/.agentworkforce/relay/workspaces.json` | | ||||||||||
| | 5 | New workspace | created only when nothing above resolves | | ||||||||||
|
|
||||||||||
| Two rules follow from the order: | ||||||||||
|
|
||||||||||
| - **The repository pin always beats the machine-global active workspace.** | ||||||||||
| Switching your active workspace (`agent-relay workspace use <name>`) never | ||||||||||
| re-homes a checkout that already pinned one. | ||||||||||
| - **A new workspace is a last resort, not a default.** A fresh directory joins | ||||||||||
| the machine's active workspace when one is selected. When nothing resolves and | ||||||||||
| a workspace is created, startup says so explicitly. | ||||||||||
|
|
||||||||||
| Startup prints the winning source (a flag name, an environment variable, or a | ||||||||||
| file path — never key material): | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| Workspace source: repository pin (/repo/.agentworkforce/relay/workspace-key.json) | ||||||||||
| Workspace: joined rw_7ccfea89 | ||||||||||
| ``` | ||||||||||
|
Comment on lines
+75
to
+78
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add a language identifier to this fenced block. Line 75 starts an unlabeled fenced block. markdownlint reports MD040. Use Proposed fix-```
+```text📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.23.1)[warning] 75-75: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||
|
|
||||||||||
| A Cloud enrollment (`RELAY_NODE_TOKEN`, or a record in the Fleet enrollment | ||||||||||
| store) selects the node's _identity_, not its workspace, so it never appears on | ||||||||||
| this ladder. If a stored enrollment addresses a different workspace than the | ||||||||||
| repository pin, `node up` refuses to start and names both source files rather | ||||||||||
| than silently choosing one. | ||||||||||
|
|
||||||||||
| ## Remote fleet agents | ||||||||||
|
|
||||||||||
| The `fleet` command group lists and controls agents across all live nodes in | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the
local upalias.This section names
agent-relay upandagent-relay node up, but notagent-relay local up. Add the alias so users can find the same workspace-resolution rules for every supported startup command.🤖 Prompt for AI Agents