Fix: Use @path prompt references for task delegation#37
Merged
tctinh merged 6 commits intotctinh:mainfrom Feb 4, 2026
Merged
Conversation
Switch delegateMode=task handoff to return a prompt string that uses OpenCode's @path attachment syntax instead of inline content. Update the task instructions and add a smoke test to assert the prompt uses @.hive/.../worker-prompt.md with no promptFile.
Assert delegateMode=task emits taskToolCall fields, omits backgroundTaskCall, and embeds the @path prompt reference in instructions. This locks the expected hive_exec_start output shape for task-based delegation.
Clarify that worker-prompt.md is passed by reference via @path tokens for task delegation. Document the recommended task() call pattern and distinguish it from hive background promptFile usage.
Add taskPromptMode: 'opencode-at-file' to hive_exec_start output when delegateMode=task. Include e2e coverage to assert the field is present alongside the task delegation response.
Document that worktrees are isolated and require bun install before running tests or builds in the worktree.
Remove brittle wording assertion for task delegation instructions and add a discovery section to the prompt-mode test plan so approval succeeds in CI. The tests now match the actual guidance string while keeping @path coverage.
3596b34 to
e3fcb6f
Compare
arxdeus
pushed a commit
to arxdeus/agent-hive
that referenced
this pull request
Mar 21, 2026
…-prompt-referencing-for-native-task Fix: Use @path prompt references for task delegation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Use @path prompt references for task delegation
The change set standardizes how delegateMode=task passes worker prompts by reference, aligns tests with the output contract, and documents the expected behavior.
Summary
taskToolCall.promptstring that uses OpenCode@pathattachment syntax (no prompt inlining).taskPromptModefield.Changes
packages/opencode-hive/src/index.tstaskToolCall.promptwith@<workerPromptPath>and removepromptFilefor task mode.taskPromptMode: 'opencode-at-file'for task delegation.@pathattachment usage.packages/opencode-hive/src/e2e/plugin-smoke.test.tstaskToolCallfields, absence ofbackgroundTaskCall, and instruction wording.taskPromptModewhendelegateMode=task.packages/opencode-hive/README.md,docs/HIVE-TOOLS.md,docs/DATA-MODEL.md: clarifyworker-prompt.mdpass‑by‑reference for task vs hive delegation.AGENTS.md: note that worktrees requirebun installbefore running tests/builds.Testing
bun run test -- packages/opencode-hive/src/e2e/plugin-smoke.test.tsManual validation
Prompt an agent to run a small task in delegateMode=task and observe whether it follows the worker prompt file reference during handoff.
Suggested prompt:
"Start a simple Hive task in delegateMode=task and tell me what prompt content you receive during the handoff, including any file references or attachments."