Skip to content

fix: read accounts with stackone_get_accounts and reconnect with a repair tool in the connection skill (ENG-3937) - #15

Open
kenngkz wants to merge 4 commits into
mainfrom
kenneth/connection-skill-accounts-tool
Open

kenngkz wants to merge 4 commits into
mainfrom
kenneth/connection-skill-accounts-tool

Conversation

@kenngkz

@kenngkz kenngkz commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

The stackone-connection skill now reads accounts with stackone_get_accounts and reconnects a broken account with a repair tool when the session has one.

  • Account reads: stackone_list_linked_accounts and stackone_get_account are replaced by stackone_get_accounts, with connector_key to list and id for one account, plus expand: "connector,connector_profile". The real tool name is checked at unified-cloud-api origin/develop 7a7fd3045.
  • Profile lookup: the account's connector_profile_id names the profile, so the skill no longer matches a profile by name.
  • Repair tool: if the session has a tool that reconnects an account by id (the mock has stackone_relink_account), the skill uses it on the broken account. The same account comes back.
  • Fallback: without such a tool, the skill links through the account's own profile with stackone_link_account. The real tool sends multiple: true, so this adds a new account beside the broken one. Staging and production have no repair tool today, so this is the path they take.
  • Old account: the skill still never deletes the broken account, and its Finish section already has the agent report what it did not do.
  • Ticket: ENG-3937

Testing

Agent runs used Haiku 5.5 on Bedrock against the mock MCP at stackone-agent develop 1ee934f8, 10 connection scenarios with 5 runs each, measured at commit 1723abb.

Setup Score (of 50)
Without the skill 36
With the skill, before 1723abb 35
With the skill at 1723abb 38
  • Reconnect scenarios: all 10 runs of the two reconnect scenarios used the repair tool and none called stackone_link_account.
  • Not benchmarked: commit 7819fbf, which only rewrites the fallback text. The mock always has the repair tool, so no run reaches that text.
  • Not tested: a live run on a session without a repair tool.
  • CI: scripts/check-manifests.py passes. No check reads skill text.

Risks

  • Fallback duplicates: on a session without a repair tool, a reconnect leaves two accounts until the user removes the broken one.
  • Rollback: revert this PR. Nothing deploys from this repo on merge.

🤖 Generated with Claude Code


Summary by cubic

The stackone-connection skill now reads accounts with stackone_get_accounts and reconnects a broken account through a repair tool when the session has one.

  • Replaces stackone_list_linked_accounts and stackone_get_account, which the management MCP doesn't expose, and reads the account's connector_profile_id rather than matching a profile by name. When that id is null, it picks the profile as in "Pick the profile deliberately" above.
  • With a repair tool such as stackone_relink_account present, it reconnects the broken account itself; without one, it falls back to a fresh link through the account's own profile, which adds a new account and leaves the broken one until the user removes it.

Testing

10 connection scenarios × 5 runs on Bedrock Haiku 5.5 against the mock scored 38 of 50 at this commit, up from 35 before; all reconnect runs used the repair tool. CI passes.

Written for commit 5ffe975. Summary will update on new commits.

View guided diff Turn on auto-fix

kenngkz and others added 3 commits November 27, 2026 16:24
The skill named stackone_list_linked_accounts and stackone_get_account, which
the management MCP does not have. Reconnect now reads connector_profile_id
from the account instead of matching the profile by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s one

The connection skill said no repair tool exists. A tool that reconnects an
existing account by id is planned, so the skill now uses it when present and
falls back to a fresh link through the account's own profile otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n the connection skill

The real stackone_link_account always sends multiple: true, so a link through the broken
account's profile creates a second account instead of repairing the first. Only a repair
tool such as stackone_relink_account keeps the same account.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kenngkz
kenngkz requested a review from glebedel as a code owner November 30, 2026 14:21

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found across 1 file

Confidence score: 3/5

  • SKILL.md may not confirm the newly linked account when another account already exists for the provider, and the fallback can preserve the broken account. Snapshot account IDs before linking so the new account can be identified.
  • SKILL.md cannot reconnect an account whose connector_profile_id is null because it attempts to link with a missing profile ID. Resolve a single applicable profile or ask the user to choose one.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/stackone-connection/SKILL.md">

<violation number="1" location="skills/stackone-connection/SKILL.md:51">
P2: This list read does not reliably confirm the newly linked account when another account already exists for the provider, especially because the fallback preserves the broken account. Snapshot the account IDs before linking and confirm a newly added account by ID (not merely any returned account) after the user completes the flow.</violation>

<violation number="2" location="skills/stackone-connection/SKILL.md:60">
P2: The fallback cannot reconnect accounts whose read has a null `connector_profile_id`; it will try to link with a missing profile ID. Handle the null case by resolving a single applicable profile (or asking the user when multiple profiles exist) before constructing the link.</violation>
</file>

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

View guided diff | Turn on auto-fix | Re-trigger cubic

`auth_link_url` to open and relay `next_steps`.
2. When the user says they are done, confirm the account exists with a read:
`stackone_list_linked_accounts` or `stackone_get_account` returns the new account. Confirm
`stackone_get_accounts {connector_key: ["<provider>"]}` returns the new account. Confirm

@cubic-dev-ai cubic-dev-ai Bot Nov 30, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This list read does not reliably confirm the newly linked account when another account already exists for the provider, especially because the fallback preserves the broken account. Snapshot the account IDs before linking and confirm a newly added account by ID (not merely any returned account) after the user completes the flow.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At skills/stackone-connection/SKILL.md, line 51:

<comment>This list read does not reliably confirm the newly linked account when another account already exists for the provider, especially because the fallback preserves the broken account. Snapshot the account IDs before linking and confirm a newly added account by ID (not merely any returned account) after the user completes the flow.</comment>

<file context>
@@ -47,28 +48,29 @@ user finishes in the browser. There is no status-poll tool.
    `auth_link_url` to open and relay `next_steps`.
 2. When the user says they are done, confirm the account exists with a read:
-   `stackone_list_linked_accounts` or `stackone_get_account` returns the new account. Confirm
+   `stackone_get_accounts {connector_key: ["<provider>"]}` returns the new account. Confirm
    success from that read, never from the fact that you started the link.
 
</file context>
Fix with cubic

Comment thread skills/stackone-connection/SKILL.md Resolved
… skill reconnect

The accounts tool returns connector_profile_id as null for some accounts
(unified-cloud-api accounts-tools.spec.ts), so the fallback link had no
profile to use. Raised by the cubic review on #15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant