core: dedupe approval not-found handling#60932
Conversation
Greptile SummaryThis PR deduplicates the
Confidence Score: 4/5Safe to merge after regenerating the Plugin SDK API baseline hash; the logic change itself is correct and behavior-preserving. One P1 finding: the public Plugin SDK surface was expanded but docs/.generated/plugin-sdk-api-baseline.sha256 was not updated, which will break the pnpm plugin-sdk:api:check CI gate. All other aspects of the refactor are correct. src/plugin-sdk/infra-runtime.ts — needs accompanying plugin-sdk-api-baseline.sha256 regeneration Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/plugin-sdk/infra-runtime.ts
Line: 17
Comment:
**Missing Plugin SDK API baseline update**
`isApprovalNotFoundError` is now re-exported from the public `openclaw/plugin-sdk/infra-runtime` subpath, which expands the tracked Plugin SDK surface. The `docs/.generated/plugin-sdk-api-baseline.sha256` hash file was not regenerated, so `pnpm plugin-sdk:api:check` (which runs in `workflow-sanity.yml`) will fail in CI.
Per the repo guidelines, after changing the public Plugin SDK surface you must run `pnpm plugin-sdk:api:gen` and commit the updated `.sha256` file alongside the change.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "core: dedupe approval not-found handling" | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR removes duplicated “approval not found” error classification logic by extracting it into a shared infra helper, then wiring both the core /approve handler and the Telegram approval resolver to use that helper. This reduces drift risk between approval submitters that need to interpret both structured gateway errors and legacy message-text errors.
Changes:
- Added
isApprovalNotFoundError()in a new shared module (src/infra/approval-errors.ts). - Updated core
/approvehandling to use the shared helper instead of in-file parsing. - Updated the Telegram exec approval resolver to import the shared helper via the plugin SDK infra runtime barrel.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/plugin-sdk/infra-runtime.ts | Re-exports the shared approval error helper for plugin/extension consumers. |
| src/infra/approval-errors.ts | Introduces centralized detection for “approval not found” across structured + legacy error shapes. |
| src/auto-reply/reply/commands-approve.ts | Removes duplicated parsing and uses isApprovalNotFoundError() for fallback routing/handling. |
| extensions/telegram/src/exec-approval-resolver.ts | Removes duplicated parsing and uses isApprovalNotFoundError() for plugin fallback decisions. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9942a423d
ℹ️ 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".
0014b56 to
9e21f1b
Compare
d29827b to
108221f
Compare
|
Merged via squash.
Thanks @gumadeiras! |
Merged via squash. Prepared head SHA: 108221f Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: 108221f Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: 108221f Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: 108221f Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: 108221f Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Summary
/approvehandling and the Telegram resolver.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
Regression Test Plan (if applicable)
User-visible / Behavior Changes
Diagram (if applicable)
N/A
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Human Verification (required)
INVALID_REQUEST+APPROVAL_NOT_FOUND, directAPPROVAL_NOT_FOUND, legacy message-text fallback.Review Conversations
Compatibility / Migration
Risks and Mitigations