Repository navigation
feat: emit permission spans so approval waits are visible in traces - #149
enternal111 wants to merge 2 commits into
Conversation
Tool approval prompts currently leave a silent hole between a step''s model response and its tool execution: the wait is only emitted as a log event, which most backends drop. Record the wait as an opencode.permission span parented to the active step (falling back to the run span), ending when permission.replied arrives with the decision recorded, or with an error when the execution ends unanswered. The new permission trace type can be disabled via OPENCODE_DISABLE_TRACES.
Codex Review Summary: ❌ FailedThis 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: 613e925be6
ℹ️ 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".
sweepExecution deletes the pendingPermissions entries first, and the span sweep matches spans to sessions through that map, so an unanswered permission span was never ended. Sweep the spans first and cover the ordering through the public execution-end path.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
3 similar comments
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Which problem is this PR solving?
Tool approval prompts leave a silent hole in traces: between a step''s model response and its tool execution, the plugin emits nothing while the user decides, so a multi-minute approval wait is indistinguishable from model or client slowness (the decision is only emitted as a log event, which many backends drop).
Short description of the changes
permission.askedstarts anopencode.permissionspan parented to the session''s active step span (the LLM step requesting the tool), falling back to the run span when no step is active.permission.repliedends the span with the decision (permission.decision= accept/reject,permission.source= the reply), OK status on accept and ERROR on reject.permissiontrace type, soOPENCODE_DISABLE_TRACES=permission(orall) turns the spans off.How Has This Been Tested?
bun run typecheckbun run lintbun test(4 new permission-span tests: parenting, fallback, disabled, unanswered sweep)