Skip to content

fix(agents): narrow broad exception handlers in deploy handoff and orchestrator - #2626

Merged
groupthinking merged 6 commits into
mainfrom
fix/2168-narrow-except-deploy-agents
Nov 19, 2026
Merged

groupthinking merged 6 commits into
mainfrom
fix/2168-narrow-except-deploy-agents

Conversation

@groupthinking

@groupthinking groupthinking commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #2665.

Refs #2168 (AUDIT-006). This is a partial slice; do not close the broad audit issue.

Result

  • Expected deployment CLI and shared-store setup failures are caught by type (SubprocessError, TimeoutExpired, OSError, SQLAlchemyError, ValueError on URL port parsing); unexpected failures propagate to explicit logged boundaries.
  • Deployment responses preserve completed GitHub work when a later Vercel step fails while reporting overall failure so partial GitHub receipts cannot mask a failed Vercel handoff.
  • Credentials are redacted in both expected CLI stderr/stdout failures and repr-escaped subprocess tracebacks.
  • Inspects AST ExceptHandler nodes (including tuple, multiline, bare, and except* syntax) rather than line counts.
  • Merged current main (44a54b0a7) and restored root vercel.json / removed temporary apps/web/vercel.json override so Vercel Preview and E2E Pipeline run cleanly.

Verification

142 passed in targeted agent/orchestrator/deployment unit tests (compileall and ruff check exit 0).

Copilot AI max review requested due to automatic review settings November 9, 2026 06:27
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Nov 19, 2026 6:46am UTC

@linear-code
linear-code Bot marked this pull request as ready for review November 9, 2026 06:27
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added documentation Improvements or additions to documentation python labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ Repository reconciliation: this PR does not reference exactly one canonical issue.

Please add a Closes #<issue> reference in the PR description so it can be tracked against the delivery plan.

See governance: #898

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical defects can expose deployment tokens in timeout logs, abort imports on malformed database URLs, and allow tests to read or write a real database.

5 open issues
What changed in this PR

This PR delivers the first slice of issue #2168’s exception-handling audit in UVAI’s internal agent runtime, focusing on deployment handoff and orchestration rather than repository-wide remediation.

Changes:

  • Narrow deployment-step and shared SQL setup handlers to expected exception types.
  • Add contextual exception logging, token redaction, and explicit boundary markers.
  • Add simulated-failure tests and document handling standards and remaining work.
File Description
tests/​unit/​test_exception_boundaries_2168.py Tests failure reporting, exception propagation, redaction, and boundary markers.
src/​youtube_extension/​services/​agents/​adapters/​agent_orchestrator.py Narrows shared-store setup handling and adds contextual boundary logs.
src/​agents/​mcp_tools/​deployment_tool.py Narrows step handlers and adds identity errors and redacted failure reporting.
docs/​EXCEPTION_HANDLING_STANDARDS.md Defines boundary markers and records this remediation slice and remaining scope.

Review effort: Max

Comment thread src/agents/mcp_tools/deployment_tool.py Resolved
Comment thread src/agents/mcp_tools/deployment_tool.py Resolved
Preserve partial deployment receipts; redact expected CLI failures and repr-escaped secrets; validate malformed URL ports without swallowing store bugs; isolate DB environment in tests; count broad handlers with AST. Disable previews for this exact review branch.

Refs #2168
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🔍 PR Validation

⚠️ Large PR detected (595 lines changed)

A failed Vercel step cannot report overall success merely because GitHub creation succeeded. Preserve the completed GitHub artifact and return failed status so pipeline classification also fails.

Refs #2168
…-narrow-except-deploy-agents

# Conflicts:
#	docs/EXCEPTION_HANDLING_STANDARDS.md
#	src/agents/mcp_tools/deployment_tool.py

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@groupthinking
groupthinking marked this pull request as ready for review November 19, 2026 06:44
@groupthinking
groupthinking merged commit 3ac561c into main Nov 19, 2026
39 of 44 checks passed
@groupthinking
groupthinking deleted the fix/2168-narrow-except-deploy-agents branch November 19, 2026 06:55

This branch was successfully deployed

1 active deployment
Preview — 191f40b5 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve deployment failures and redact command error output

3 participants