Repository navigation
feat(trellis): delegate_task forks are worker spawns with a knowledge option - #25
Conversation
…edge option
A fork made for a delegated child is sent with spawn: true, so Trellis
gives it the project knowledge tier read-only by default, and
workspace.fork.knowledge ({project, notes, groups, groupsRw}) passes
through to POST /v1/fork. The worker guide names the knowledge paths.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…group names checked T3 forks on the user socket, which Trellis does not limit, so delegate_task checks the lead's own access (GET /v1/knowledge): project write, and each existing group at the access handed out; new groups are created by the spawn. Group names follow Trellis's [a-z0-9_-]. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s and only the lead's own groups A lead that sees no project tier hands its worker none (the worker default, read, is lowered), group access is looked up only among the lead's own groups, and a Trellis without knowledge tiers still forks a worker that asked for none. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7cd6b7e7d
ℹ️ 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".
| Effect.catch((error) => | ||
| input.knowledge === undefined && error.message.startsWith("This Trellis does not support") | ||
| ? Effect.succeed({ knowledge: undefined }) | ||
| : Effect.fail(unavailable(error)), |
There was a problem hiding this comment.
Treat empty knowledge objects as default requests
On a Trellis version without the knowledge endpoints, knowledge: {} (or an object containing only empty group arrays) has exactly the same effective defaults as omitting knowledge, but this compatibility branch only accepts literal undefined. Since the contract permits an empty object, an agent can make a no-op knowledge request and unexpectedly get an orchestration error instead of the fork that the adjacent fallback promises; normalize empty/default-only knowledge before deciding whether the unsupported endpoint should block the spawn.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid: an absent knowledge, {} or empty group lists all count as the worker defaults, so a Trellis without knowledge tiers forks for any of them. Fixed in bbdf6b0.
…Trellis without tiers Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lane T3 for the Env lane's knowledge tiers (Trellis "Knowledge tiers" in docs/api.md; design in docs/v1/agent-profiles.md §6 and §8).
Change
delegate_taskworkspace: {fork}) is sent toPOST /v1/forkwithspawn: true. Trellis then gives the worker the project tier read-only by default.workspace.fork.knowledgeoption:{project?: rw|ro|none, notes?: inherit|empty, groups?, groupsRw?}, sent as Trellis'sknowledge(groupsRw→groups_rw). Group names follow Trellis's[a-z0-9_-]. The tool description explains the defaults.delegate_taskchecks the lead's own access first, throughGET /v1/knowledgeandGET /v1/knowledge/groups:/trellis/knowledge/project, the groups and/trellis/notes.Open (Trellis side)
Checking access and creating the fork are separate calls. A group created by someone else, or a grant revoked, between the check and the fork escapes the check. Closing this needs an atomic check in Trellis's fork, e.g. Trellis checking
groupsagainst thespawned_by/source workspace's access when a fork carriesspawn: true.Checks
TrellisWorkers.test.ts: spawn and knowledge passed through; refusals for project write, a hidden group, write to a read-only group, and a hidden group namedconstructor; the lead's own and new groups allowed; a lead with no project tier refusedroand its default lowered to none.Trellis.test.ts: the fork body uses Trellis's names.knip:check,vp check,vpr typecheckandrelease-smokepass.t3tests fail only on the knownCodexInstallationandAcpSessionRuntime.processTreefailures. Package tests fail only on the known desktop libsecret and snapshot file-mode failures; client-runtime, relay and mobile pass when run separately.build:desktopfails on the known libsecret helper.🤖 Generated with Claude Code