Skip to content

fix(frontend): repair gateway integration drawers - #6382

Open
Aman-goel-04 wants to merge 2 commits into
Agenta-AI:mainfrom
Aman-goel-04:gateway-integration-drawer-repairs
Open

fix(frontend): repair gateway integration drawers#6382
Aman-goel-04 wants to merge 2 commits into
Agenta-AI:mainfrom
Aman-goel-04:gateway-integration-drawer-repairs

Conversation

@Aman-goel-04

@Aman-goel-04 Aman-goel-04 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Closing an integration permission drawer with the X wrote permission changes into the agent draft, even though the X reads as cancel. The drawer now keeps permission edits locally and applies them only when the user clicks Done.

Invalid OAuth connections in Add integration were marked needs reconnect but only offered Add. They now expose Reconnect and Remove actions directly in that drawer.

The reported All Apps count mismatch was investigated separately. The current catalog intentionally shows connected integrations in both sections so users can connect another account; the displayed count matches the rendered rows.

Fixes #6348

Testing

Verified locally

  • Ran pnpm --filter @agenta/entity-ui lint.
  • Ran pnpm --filter @agenta/entity-ui build.
  • Ran pnpm --filter @agenta/entity-ui test:unit.
  • Verified locally in the real app:
    • Change a tool permission, close with X, reopen the drawer. The change is discarded.
    • An invalid connection in Add integration shows Reconnect and Remove.
    • Google Calendar and GitHub searches show All Apps counts that match their rendered rows.

Added or updated tests

N/A. The existing catalog unit tests already cover the intentional behavior of showing connected integrations in both Connected in your workspace and All Apps.

QA follow-up

N/A

Demo

Attach real-app captures from this branch:

  • Before #1.mp4: Closing the permission drawer with X persists the edited permission.
Before.1.mp4
  • After #1.mp4: Closing the permission drawer with X discards the edited permission.
After.1.mov
  • Before #2.mp4: An invalid connection in Add integration is marked needs reconnect but offers only Add.
Before.2.mov
  • After #2.mp4: An invalid connection in Add integration now offers Reconnect and Remove.
After.2.mov
  • Screenshots showing Google Calendar (3 rows / ALL APPS 3) and GitHub (6 rows / ALL APPS 6) count verification. No code change was needed for this reported behavior.
Screenshot 2026-08-31 at 1 37 47 AM Screenshot 2026-08-31 at 1 37 03 AM

Checklist

  • Demo shows the real app running this branch (not a mock-up or recreated UI), or is marked N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Copilot AI lite review requested due to automatic review settings August 30, 2026 20:44
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 30, 2026

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Aman-goel-04 is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 9af28aaa-efc4-4dfc-b7a4-1785717c020c

📥 Commits

Reviewing files that changed from the base of the PR and between 1dc9715 and 5246388.

📒 Files selected for processing (2)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/AgentIntegrationDrawer.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/IntegrationPermissionDrawer.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/IntegrationPermissionDrawer.tsx

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


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added options to add, reconnect, or remove incomplete integrations from the integration drawer.
    • Reconnect and remove actions are available for invalid single-connection integrations.
  • Bug Fixes

    • Permission changes are saved only when selecting Done.
    • Closing the permissions drawer without saving discards pending changes.
    • Permission edits correctly update individual tool settings and reset when reopening the drawer.

Walkthrough

The integration drawer adds reconnect and removal actions for invalid single connections. The permission drawer stages changes locally, saves them with “Done”, and discards them when closed without saving.

Changes

Integration drawer updates

Layer / File(s) Summary
Invalid connection recovery
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/AgentIntegrationDrawer.tsx
Invalid single connections show Reconnect and confirmed Remove actions. Multi-connection groups do not show these actions.
Permission draft and save flow
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/IntegrationPermissionDrawer.tsx
Permission edits use local draft state. The draft resets when the drawer opens. The Done button saves the draft and closes the drawer.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟡 Moderate · up to 52463

The invalid-connection drawer can still offer Add alongside Reconnect, allowing users to start the wrong flow, while reported lint failures and overlapping reconnect/remove actions leave additional merge-readiness concerns. The PR should not merge until these issues are fixed or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant ConnectedRow
  participant ReconnectButton
  participant useReconnectToolConnection
  participant modal
  participant useToolConnectionActions
  ConnectedRow->>ReconnectButton: render for invalid single connection
  ReconnectButton->>useReconnectToolConnection: reconnect connection
  ConnectedRow->>modal: confirm connection removal
  modal->>useToolConnectionActions: delete connection
Loading
sequenceDiagram
  actor User
  participant DrawerBody
  participant IntegrationPermissionDrawer
  participant Parent
  User->>DrawerBody: change tool permission
  DrawerBody->>IntegrationPermissionDrawer: update draft permission
  User->>IntegrationPermissionDrawer: click Done
  IntegrationPermissionDrawer->>Parent: save draft permissions
  IntegrationPermissionDrawer->>User: close drawer
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 60.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #6348 objectives [#6348]: permission edits remain local until Done, invalid OAuth connections expose Reconnect and Remove, and the All Apps count behavior was verified as int…
Out of Scope Changes check ✅ Passed The modified files contain changes limited to the gateway integration drawer behaviors described in issue #6348. No unrelated code changes are identified.
Description check ✅ Passed The description directly explains both drawer fixes, the All Apps count investigation, and the validation performed.
Title check ✅ Passed The title clearly summarizes the main frontend changes to the gateway integration drawers.
Full details: Linked Issues check

Explanation

The changes address issue #6348 objectives [#6348]: permission edits remain local until Done, invalid OAuth connections expose Reconnect and Remove, and the All Apps count behavior was verified as intentional and consistent with rendered rows.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI review requested due to automatic review settings August 30, 2026 20:48
@Aman-goel-04
Aman-goel-04 force-pushed the gateway-integration-drawer-repairs branch from ca58a14 to 1dc9715 Compare August 30, 2026 20:48

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b9b32e9-c169-4507-b7e0-d0fa2db7a744

📥 Commits

Reviewing files that changed from the base of the PR and between 4b474bf and ca58a14.

📒 Files selected for processing (2)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/AgentIntegrationDrawer.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/IntegrationPermissionDrawer.tsx

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 47cf6769-e6df-4c11-9eee-736458f82e43

📥 Commits

Reviewing files that changed from the base of the PR and between ca58a14 and 1dc9715.

📒 Files selected for processing (1)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/AgentIntegrationDrawer.tsx

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

Comment on lines +172 to +173
<div className="flex shrink-0 items-center gap-1.5">
{reconnectable ? <ReconnectButton connection={single} /> : null}

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Hide Add for invalid connections.

When reconnectable is true, the action row still renders Add at Lines 177-181. Move Add into the non-reconnectable branch so invalid connections expose only Reconnect and Remove.

Copilot AI review requested due to automatic review settings August 30, 2026 20:59
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 30, 2026

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug frontend size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(bug) Integration drawer polish: X applies edits, dead connection cannot be fixed, stale app count

2 participants