Uh oh!
There was an error while loading. Please reload this page.
fix(cli): handle descendant permission asks - #36898
Conversation
The following comment was made by an LLM, it may be inaccurate: Related PRs FoundWhile PR #36898 is the current PR being checked, here are related PRs that address similar or overlapping concerns:
These are evolutionary/related improvements to the same feature area. The current PR (#36898) specifically improves upon #35823 with better fallback handling and regression test coverage. |
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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:
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. |
Issue for this PR
Closes#36868
Type of change
What does this PR do?
Headless
opencode runonly answered permission requests from the root session, so a Task child requesting permission blocked both sessions indefinitely.This tracks descendants from session events and verifies missed sessions by following
parentID. Descendant requests now use the existing--autoapprove / non-auto reject policy. A failed ancestry lookup cancels the pending local request and makes a bounded best-effort server abort instead of leaving the CLI blocked.Related: #35823. This version avoids
session.list()pagination limits and adds a real Task-child subprocess regression.How did you verify your code works?
bun run typecheckinpackages/opencodebun test test/cli/run/permission-session-tree.test.ts(4 pass, 0 fail)bun run script/build.ts --single, CLI smoke test, and compiled CLI + fake LLM reproduction (parent completed and child marker was created)The complete subprocess test file cannot run in this Windows checkout because Bun panics while importing its runtime fixture; the equivalent compiled-binary flow passed and the regression test is included for CI. The monorepo pre-push check is also blocked because the tracked app symlink is checked out as path text on Windows; the changed
opencodepackage passes typecheck.Screenshots / recordings
Not applicable; this changes headless CLI behavior.
Checklist