Repository navigation
refactor: consolidate Teams and error helpers - #117907
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 4:25 AM ET / 08:25 UTC. ClawSweeper reviewWhat this changesThis PR replaces duplicate Microsoft Teams Graph POST/PATCH helpers and local error-message formatters with shared canonical helpers, while preserving Matrix, Qwen, Code Mode, and OpenAI HTTP behavior. Merge readinessThis is a coherent behavior-preserving cleanup with focused regression coverage and terminal test evidence in the PR body; no concrete patch defect or security concern was found. The Priority: P3 Review scores
Verification
How this fits togetherMicrosoft Teams channel actions issue Graph API mutations and parse responses, while the gateway, agent runtime, Matrix channel, and Qwen provider each turn internal failures or provider configuration into operator-visible results. This PR centralizes repeated helper logic at those boundaries without changing the surrounding request or delivery flows. flowchart LR
A[Teams actions] --> B[Graph mutation helper]
B --> C[Microsoft Graph API]
C --> D[Response parsing and release]
E[Gateway, agents, Matrix] --> F[Canonical error formatter]
G[Qwen provider config] --> H[Validated video endpoint]
F --> I[Operator-visible errors]
D --> I
H --> I
Before merge
Agent review detailsSecurityNone. PR surfaceSource -58, Tests +46. Total -12 across 17 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the consolidated helpers only after the remaining CI confirms the focused behavior-preservation claims, retaining the distinct Teams DELETE release owner and Code Mode interruption classification. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is an internal refactor, and the supplied focused test runs cover the preserved request, parsing, timeout, and fallback behavior rather than a new user-reported failure. Is this the best way to solve the issue? Yes. Consolidating the duplicate helpers at their existing owner boundaries is the most maintainable path; the review found no unsupported duplicate API or broad fallback removal. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6b625357fcae. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: fix: stop lost cancellations, false success, and stuck Codex compaction (openclaw#117902) fix(cli): reject incomplete hosted video downloads (openclaw#117893) refactor(board): remove duplicate in-memory store (openclaw#117353) refactor: consolidate Teams and error helpers (openclaw#117907) fix(msteams): cancel unread Graph error response bodies (openclaw#117664) fix(imessage): rewind the recovery cursor when chat.db is replaced at the same path (openclaw#117788) feat(browser): relay CDP compat for Puppeteer clients (chrome-devtools-mcp) (openclaw#117915)
* origin/main: fix: stop lost cancellations, false success, and stuck Codex compaction (openclaw#117902) fix(cli): reject incomplete hosted video downloads (openclaw#117893) refactor(board): remove duplicate in-memory store (openclaw#117353) refactor: consolidate Teams and error helpers (openclaw#117907) fix(msteams): cancel unread Graph error response bodies (openclaw#117664) fix(imessage): rewind the recovery cursor when chat.db is replaced at the same path (openclaw#117788) feat(browser): relay CDP compat for Puppeteer clients (chrome-devtools-mcp) (openclaw#117915)
What Problem This Solves
Several small request and error-formatting paths still duplicated canonical behavior. Teams carried three Graph mutation wrappers plus a second unused mutation-capable read API, two attachment redirect predicates, and test-only response defensiveness. OpenAI HTTP, Matrix delivery reconciliation, and Code Mode each retained local generic error helpers. Qwen video generation also kept URL-prefix fallbacks that its validated request-config producer cannot reach.
Why This Change Was Made
This change consolidates Teams POST/PATCH requests into one mutation function while retaining DELETE as the distinct response-release owner. It moves both attachment paths onto one redirect predicate, uses the canonical core/plugin error formatter at each valid boundary, keeps Code Mode's raw interruption sentinel check ahead of formatting, and preserves Matrix's explicit unknown-error fallback. Qwen now relies on its validated absolute URL producer while retaining custom-host trailing-slash normalization.
The workboard error helper was audited and intentionally left unchanged because its shipped record and fallback semantics are not equivalent to the canonical formatter and current callers do not prove those inputs impossible.
User Impact
No intended behavior change. Graph request methods, beta routing, error labels, bounded response parsing, DELETE body release, redirect handling, OpenAI validation text trimming, Matrix fallback text, Code Mode timeout classification, and Qwen custom URL normalization are preserved. Production code shrinks by 58 lines.
Evidence
node scripts/run-vitest.mjs extensions/msteams/src/graph.test.ts extensions/msteams/src/graph-group-management.test.ts extensions/msteams/src/graph-messages.actions.test.ts extensions/msteams/src/graph-messages.read.test.ts extensions/msteams/src/graph-messages.search.test.ts— 75 passednode scripts/run-vitest.mjs extensions/msteams/src/attachments.test.ts extensions/msteams/src/attachments/shared.test.ts extensions/msteams/src/attachments.graph.test.ts— 82 passednode scripts/run-vitest.mjs src/gateway/openai-http.test.ts— 33 passednode scripts/run-vitest.mjs extensions/matrix/src/matrix/delivery-plan.test.ts extensions/qwen/video-generation-provider.test.ts— 14 passednode scripts/run-vitest.mjs src/agents/code-mode.limits.test.ts src/agents/code-mode-worker-lifecycle.test.ts— 24 passedoxfmtcompleted on all 17 changed files.git diff --checkpassed.node scripts/check-changed.mjsattempted hosted proof, but no configured Crabbox/Testbox provider was ready; heavy proof is left to this PR's CI as required for this worktree.