Skip to content

fix(opencode): merge session permissions in task descriptions - #48107

Closed
mengwEX wants to merge 1 commit into
anomalyco:devfrom
mengwEX:task-session-permissions
Closed

mengwEX wants to merge 1 commit into
anomalyco:devfrom
mengwEX:task-session-permissions

Conversation

@mengwEX

@mengwEX mengwEX commented Sep 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #48106

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Pass merged agent and session permissions to describeTask, so its available-agent list reflects session deny, allow, and ask overrides, matching execution-time evaluation.

This resubmits only the description permission merge from #41100, which was closed by automated cleanup. No changes to target visibility policy or execution checks.

How did you verify your code works?

Using Bun 1.3.14 in packages/opencode:

  • bun test test/tool/registry.test.ts test/session/tools.test.ts test/permission-task.test.ts --timeout 30000 — 43 pass.
  • bun typecheck — pass; the pre-push full-workspace typecheck also passed (30/30 tasks).
  • Six regression cases cover omitted/empty session permissions, deny/allow/ask overrides, and wildcard rule ordering. The four override cases fail against the unmodified base and pass with the fix.
  • Prettier and git diff --check pass.

Screenshots / recordings

No UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@mengwEX

mengwEX commented Sep 22, 2026

Copy link
Copy Markdown
Author

Friendly follow-up: this PR is intentionally limited to merging session permissions into the legacy describeTask agent list. It does not change runtime enforcement, child-session inheritance, or whole-tool visibility. The related-issue distinctions are documented in #48106. The regression cases fail on the unmodified base and pass with this patch; 43 targeted tests and the full workspace typecheck pass. When someone has a moment, could this get a review?

@mengwEX
mengwEX force-pushed the task-session-permissions branch from 39eaa86 to f6ac9ed Compare September 22, 2026 03:21
@mengwEX
mengwEX force-pushed the task-session-permissions branch from f6ac9ed to c3ee827 Compare October 9, 2026 09:21
@mengwEX

mengwEX commented Oct 9, 2026

Copy link
Copy Markdown
Author

Hi @rekram1-node, since #48106 is assigned to you, could you approve the fork workflows for this PR and take a look when you have time?

I've rebased onto the latest dev (c3ee827). The 43 targeted tests and full workspace typecheck pass locally. The new test/E2E, typecheck, and nix-eval runs are awaiting maintainer approval; the original September 9 runs expired without approval.

The change remains limited to merging session permissions into the Task description. Thank you!

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@mengwEX

mengwEX commented Oct 16, 2026

Copy link
Copy Markdown
Author

Hi @rekram1-node, this fix is still actively maintained. Could you reopen this PR after the automated cleanup and approve the fork CI workflows?

The branch was rebased onto dev on October 9 (c3ee827); all 43 targeted tests and the full workspace typecheck passed locally at that revision. The upstream CI workflows needed maintainer approval before they could run. The scope remains the session-permission merge in describeTask for #48106.

I tried reopening the PR directly, but GitHub rejected the request. Thank you for taking a look.

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.

Subagent description ignores session permissions

1 participant