Skip to content

fix(account): close DB broker HTTP errors - #2330

Merged
krishhgg merged 2 commits into
developfrom
fix/rr-2324-db-broker-http-errors
Sep 18, 2026
Merged

krishhgg merged 2 commits into
developfrom
fix/rr-2324-db-broker-http-errors

Conversation

@krishhgg

@krishhgg krishhgg commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • close DB broker and Microsoft 365 HTTPError responses on terminal and retry paths
  • preserve existing status codes response details retry behavior and user-facing errors
  • cover app-only auth broker refresh Graph requests and OneDrive chunk uploads

Type

fix

Testing

  • Tests added or updated
  • ./builder test:fast lint:check surfaces:check not run locally; GitHub CI is the final repository-wide gate
  • Engine-dependent suites not run locally; focused engine-free pytest coverage passed
Microsoft 365 focused suite: 147 passed
ruff check + ruff format --check: passed
develop/stage range-diff: all 2 commits equivalent

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Docs updated in the same change (not applicable; internal resource cleanup only)
  • Breaking changes documented (not applicable; no breaking changes)

Agent context

OpenAI Codex (gpt-5.6-sol) / T3 Code, autonomous under explicit approval. Focused tests and develop/stage patch parity were verified locally; engine-dependent builder suites remain delegated to GitHub CI.

Paired PR

Stage: #2366

Linked Issue

Fixes #2324

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0e70b95b-4a36-4e8a-be3c-eaf61c2598f4

📥 Commits

Reviewing files that changed from the base of the PR and between 5f0272a and 8e3a83e.

📒 Files selected for processing (4)
  • nodes/src/nodes/tool_microsoft_365/graph_client.py
  • nodes/src/nodes/tool_microsoft_365/onedrive/client.py
  • nodes/test/tool_microsoft_365/test_graph_client.py
  • nodes/test/tool_microsoft_365/test_onedrive_invite_gate.py

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

HTTP error handlers now close response bodies before raising errors, retrying, or continuing. The existing status codes and exception behavior remain in place. Tests verify closure across DB broker, Microsoft Graph, and OneDrive paths.

Changes

HTTP error response cleanup

Layer / File(s) Summary
DB broker response cleanup
packages/ai/src/ai/account/base.py, packages/ai/tests/ai/account/test_resolve_db_dsn.py
The DB broker captures the status code and closes the HTTPError response before raising RuntimeError. Tests cover a mocked 503 response.
Microsoft Graph error cleanup
nodes/src/nodes/tool_microsoft_365/graph_client.py, nodes/test/tool_microsoft_365/test_graph_client.py
Graph token and request handlers close HTTPError responses in rejection, retry, and error-detail paths. Tests verify closure for token, refresh, throttling, and scope-fix cases.
OneDrive upload error cleanup
nodes/src/nodes/tool_microsoft_365/onedrive/client.py, nodes/test/tool_microsoft_365/test_onedrive_invite_gate.py
Chunked upload handling closes responses on retry and failure paths. Tests verify closure for transient and non-transient failures.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 8e3a8

HTTP error responses are released on the covered broker, Microsoft Graph, and OneDrive paths without an evidenced behavior regression. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The DB broker changes and their regression test implement Issue #2324. The additional changes in nodes/src/nodes/tool_microsoft_365/graph_client.py, `nodes/src/nodes/tool_microsoft_365/onedrive/clie… Remove the unrelated Microsoft Graph and OneDrive production and test changes from this pull request, or link them to a separate issue and submit them separately.
Docstring Coverage ⚠️ Warning Docstring coverage is 13.04% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #2324 requires response closure, preserved status and RuntimeError semantics, a deterministic regression test, and passing account and DSN tests with warnings treated as errors. The PR closes …
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: closing DB broker HTTP errors in the account module. It is concise and directly related to the stated objectives, although it does not mention the addi…
Full details: Out of Scope Changes check

Explanation

The DB broker changes and their regression test implement Issue #2324. The additional changes in nodes/src/nodes/tool_microsoft_365/graph_client.py, nodes/src/nodes/tool_microsoft_365/onedrive/client.py, and their tests change Microsoft Graph and OneDrive HTTP error handling. The linked issue does not cover these components, and the summary provides no connection to Issue #2324.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@krishhgg

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@github-actions github-actions Bot added the module:ai AI/ML modules label Sep 17, 2026
@krishhgg
krishhgg changed the base branch from stage to develop September 17, 2026 22:20
asclearuc
asclearuc previously approved these changes Sep 18, 2026

@asclearuc asclearuc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kgarg2468 — correct fix, and the test is the right one: asserting response_body.closed pins the actual resource behaviour instead of re-checking the error message. Capturing e.code before e.close() and keeping from e preserves the existing error contract exactly.

Approve

One non-blocking should fix is inline: four other HTTPError handlers in the repo drop the response the same way, and it may be worth deciding now whether to widen the fix or file a follow-up.

Comment thread packages/ai/src/ai/account/base.py Resolved
@krishhgg

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot added the module:nodes Python pipeline nodes label Sep 18, 2026
@krishhgg
krishhgg merged commit 2339341 into develop Sep 18, 2026
24 of 28 checks passed
@krishhgg
krishhgg deleted the fix/rr-2324-db-broker-http-errors branch September 18, 2026 19:39
dylan-savage pushed a commit that referenced this pull request Sep 18, 2026
* fix(account): close DB broker HTTP errors

Closes #2324

* fix(microsoft-365): close HTTP error responses

---------

Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net>
AviNormie pushed a commit to AviNormie/rocketride-server that referenced this pull request Nov 9, 2026
* fix(account): close DB broker HTTP errors

Closes rocketride-org#2324

* fix(microsoft-365): close HTTP error responses

---------

Co-authored-by: Krish Garg <kg@g14-node1.tailb99b1b.ts.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ai AI/ML modules module:nodes Python pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Close DB broker HTTP error responses

3 participants