Skip to content

fix: #3359 preserve local approval rejection reasons#3360

Merged
seratch merged 1 commit into
openai:mainfrom
Aphroq:fix/approval-rejection-reason
May 11, 2026
Merged

fix: #3359 preserve local approval rejection reasons#3360
seratch merged 1 commit into
openai:mainfrom
Aphroq:fix/approval-rejection-reason

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 11, 2026

Summary

Preserve non-empty rejection reasons returned by local tool on_approval callbacks when recording an automatic rejection.

The public local approval callback result can include a reason, and hosted MCP approval handling already propagates rejection reasons through its own path. This change keeps shell, apply_patch, and custom local tool rejection outputs consistent with the callback decision while preserving the existing default rejection text when the reason is missing, empty, or not a string.

Test plan

  • uv run pytest tests/test_shell_tool.py tests/test_apply_patch_tool.py tests/test_custom_tool.py -q
  • bash .agents/skills/code-change-verification/scripts/run.sh

The focused local approval tests pass on this branch directly. The full shell verification script was run in a local validation checkout where this branch was temporarily combined with the pending tracing shutdown fix, so the tracing atexit cleanup test would not time out.

Issue number

Closes #3359

Checks

  • I've added new tests (if relevant)
  • I've run make lint and make format
  • I've made sure tests pass

@Aphroq Aphroq changed the title Preserve local approval rejection reasons fix: #3359 preserve local approval rejection reasons May 11, 2026
@seratch seratch added this to the 0.17.x milestone May 11, 2026
@seratch seratch enabled auto-merge (squash) May 11, 2026 22:27
@seratch seratch merged commit b2bd821 into openai:main May 11, 2026
18 of 19 checks passed
@github-actions github-actions Bot mentioned this pull request May 11, 2026
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.

Local on_approval rejection reasons are dropped

2 participants