Fix sidebar nagging Connect when the single-connection fallback applies#148
Merged
Conversation
…lies The sidebar's "Action needed" list (workspace layout) reimplemented the missing-connection check with a strict slot-name match and lacked the native single-connection fallback that the run-blocking pre-flight has. So an agent that pins `attio:tembo` while the user has exactly one Attio connection named `default` would run fine, yet the sidebar kept showing "Attio (tembo) Connect". Extracts the slot inventory + the missing-slot predicate into shared helpers (buildConnectionSlotSets + isAgentConnectionMissing) in connection-checks.ts and routes both findMissingConnections and the sidebar through them, so they can't drift again. The existing single-connection fallback tests now cover the sidebar path too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
After removing duplicate connections, the sidebar's Action needed cards still showed "Attio (tembo) for 3 agents — Connect" and "Pylon (tembo) for day-planner — Connect", even though those agents run fine.
Cause
The sidebar (workspace
layout.tsx) reimplemented the missing-connection check with a strict slot-name match and was missing the native single-connection fallback that the run-blocking pre-flight (findMissingConnections) has. So when an agent pinsattio:tembobut the user has exactly one Attio connection (named e.g.default), the runtime uses it and the agent runs — but the sidebar's strictattio:tembolookup missed and kept nagging. The two had drifted (despite a comment claiming "same slot logic").Fix
Extract the slot inventory + the missing-slot predicate into shared helpers in
connection-checks.ts:buildConnectionSlotSets(composio, native, secrets)— the bucketed lookups (incl. per-provider active-native counts).isAgentConnectionMissing(source, toolkit, name, sets)— the single predicate, including the single-connection fallback.Both
findMissingConnections(run pre-flight) and the sidebar now call these, so they can't drift again. The existing single-connection-fallback tests now cover the sidebar path through the shared predicate.Verification
vitest(connection-checks) ✓ ·tsc --noEmit+eslint+next build✓🤖 Generated with Claude Code