Skip to content

fix(opencode): answer subagent permissions in run - #43675

Merged
rekram1-node merged 1 commit into
devfrom
subagent-permissions
Aug 21, 2026
Merged

fix(opencode): answer subagent permissions in run#43675
rekram1-node merged 1 commit into
devfrom
subagent-permissions

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • track child and nested child sessions created by a non-interactive run
  • auto-approve or auto-reject permission requests only for that run session tree
  • add subprocess coverage for both dangerous auto-approval and default rejection

Validation

  • bun test test/cli/run/run-process.test.ts -t "answers requested permissions from subagents"
  • bun x prettier --check src/cli/cmd/run.ts test/cli/run/run-process.test.ts
  • git diff --check

Requested by: @rekram1-node (Aiden via Slack)

@rekram1-node
rekram1-node merged commit 08faeb3 into dev Aug 21, 2026
10 of 11 checks passed
@rekram1-node
rekram1-node deleted the subagent-permissions branch August 21, 2026 00:29
@Abioy

Abioy commented Aug 21, 2026

Copy link
Copy Markdown

@rekram1-node thx for the fix, this resolves the hang for subagents created during the current run.

One remaining corner case: a subagent resumed via the task tool's task_id in a new run was created in a previous process, so no session.created fires and its session is never added to the tracked set(sessions), its permission.asked gets silently dropped and the run hangs.

1056674754 added a commit to 1056674754/opencode that referenced this pull request Aug 31, 2026
Upstream v1.18.19 (2b72179) -> v1.18.20 (7248bc1), 23 commits.

Functional changes:
- fix(opencode): surface resumable subagent errors (anomalyco#43657)
- fix(opencode): answer subagent permissions in run (anomalyco#43675)
- fix(opencode): preserve Cerebras completion limit (anomalyco#43736)
- fix(opencode): retry xAI capacity stream errors (anomalyco#43640)
- fix(opencode): retry network error variants (anomalyco#43806)
- fix(opencode): retry raw network finish errors (anomalyco#43813)
- fix(opencode): surface subagent tool errors (anomalyco#43821)
- test(opencode): remove flaky subagent test (anomalyco#43819)
- feat(go): add Ox Alpha to usage graph (anomalyco#43809); docs + i18n updates

Conflicts resolved: 29 package.json version bumps (rebranded 1.18.20-sscity),
bun.lock (took upstream, rebranded workspace entries via bun install).
session/llm/ai-sdk.ts finish-step reconciled by hand: upstream
rawFinishReason network_error check runs first (provider-declared failure,
specific message), then the fork empty-finish retry heuristic inside the
generator; duplicate ProviderError import from both sides deduplicated.
retry.ts auto-merged: upstream network[-_\s]error and at-capacity patterns
adopted; fork content-policy maxAttempts cap and 5xx-always-retryable logic
untouched. task.ts, cerebras.ts, plugin/index.ts, and run.ts auto-merged
cleanly: upstream resumable subagent task_id error surfacing, subagent
permission session tracking, and Cerebras maxOutputTokens guard adopted
alongside. Tests from both sides kept: upstream network_error finish-reason
processor/llm tests plus fork overload-retry, empty-stream, content-policy,
and single-flight regressions all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants