Skip to content

feat(platform): add list_user_credentials CoPilot tool for credential discovery - #13701

Open
Abhi1992002 wants to merge 11 commits into
devfrom
tue-pr-1
Open

feat(platform): add list_user_credentials CoPilot tool for credential discovery#13701
Abhi1992002 wants to merge 11 commits into
devfrom
tue-pr-1

Conversation

@Abhi1992002

Copy link
Copy Markdown
Member

Why / What / How

Why: CoPilot has no way to know which credentials/integrations the user has already connected before attempting a task (REQ-112). Its only discovery paths today are shelling out to gh auth status (GitHub-only, E2B-only) or attempting a run_block/run_agent and reading back the missing-credentials list. connect_integration always assumes the user is not connected. The result is unnecessary sign-in prompts for integrations that are already connected.

What: A new list_user_credentials CoPilot tool that returns secret-free metadata about every credential the user has connected (provider, type, title, OAuth scopes, username, host, managed flag), with an optional provider filter — plus a chat card that renders the connected integrations, and system-prompt guidance telling the model to check before surfacing sign-in cards.

How:

  • The tool reuses the exact secret-stripping serialization the integrations API already uses (to_meta_responseCredentialsMetaResponse), so no new secret-handling surface is introduced.
  • System credentials (platform-provided API keys from settings.secrets, identified via SYSTEM_CREDENTIAL_IDS) and SDK default credentials (is_sdk_default) are filtered out — they are not user-connected integrations and would mislead the model. Managed credentials (e.g. AgentMail) are included and flagged is_managed; the tool runs the same bounded managed-credential provisioning sweep as GET /credentials, and marks the inventory provisioning_complete=false when that sweep fails.
  • Chose the on-demand tool over injecting a summary into the system prompt (the ticket's alternative): the system prompt is deliberately byte-identical across users for cross-session prompt caching, and per-user injection was explicitly declined before for that reason (see budget_context notes in service.py). A tool has no cache cost and returns fresh data mid-session.
  • The tool-schema char budget in tool_schema_test.py is bumped 51500 → 52000 with the documented rationale convention (new tool measures ~500 chars; registry now at 51291).

Changes 🏗️

Backend

  • backend/copilot/tools/list_credentials.py — NEW: ListUserCredentialsTool (requires_auth, optional provider filter) + CredentialListResponse
  • backend/copilot/tools/models.pyResponseType.CREDENTIAL_LIST
  • backend/copilot/tools/__init__.py — registers list_user_credentials
  • backend/copilot/permissions.pylist_user_credentials added to the ToolName Literal (registry sync)
  • backend/copilot/prompting.py — new rule 0 in "Credentials & sign-in surfacing": check list_user_credentials before prompting sign-in; fixed the stale "check credentials via connect_integration" reference (that tool cannot check anything)
  • backend/copilot/tools/tool_schema_test.py — budget bump with rationale
  • backend/copilot/tools/list_credentials_test.py — NEW: 17 unit tests (filtering of system/SDK-default creds, provider filter, no-secrets serialization incl. host-scoped/MCP, provisioning-failure marking, auth guard, error paths)

Frontend

  • src/app/(platform)/copilot/tools/ListCredentialsTool/ — NEW: chat card (accordion of connected integrations with provider, auth type, account, host, scopes) + helpers + 7 Vitest tests
  • MessagePartRenderer.tsx / ChatMessagesContainer/helpers.ts — render case + custom-tool allowlist entry
  • src/app/api/openapi.json — regenerated; diff is the single new credential_list enum value

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • poetry run pytest backend/copilot/tools/list_credentials_test.py backend/copilot/tools/tool_schema_test.py — 207/207 pass
    • poetry run format (ruff/isort/black/pyright) — clean
    • npx vitest run ListCredentialsTool — 7/7 pass
    • pnpm lint && pnpm types — clean (my files)
    • pnpm generate:api — regenerated client includes credential_list

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes) — no configuration changes

… discovery

CoPilot had no way to know which credentials/integrations a user has already
connected before attempting a task, causing unnecessary sign-in prompts for
integrations that are already connected (REQ-112).

Add a list_user_credentials CoPilot tool that returns secret-free metadata about
every credential the user has connected (provider, type, title, OAuth scopes,
username, host, managed flag), with an optional provider filter. Reuses the same
to_meta_response serialization the integrations API uses, so no new
secret-handling surface is introduced. System credentials and SDK default
credentials are filtered out; managed credentials are provisioned via the same
bounded sweep as GET /credentials and the inventory is marked incomplete if that
sweep fails.

Adds a chat card that renders the connected integrations and system-prompt
guidance telling the model to check before surfacing sign-in cards.
@Abhi1992002
Abhi1992002 requested a review from a team as a code owner July 28, 2026 15:12
@Abhi1992002
Abhi1992002 requested review from 0ubbe and kcze and removed request for a team July 28, 2026 15:12
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Jul 28, 2026
@Abhi1992002

Copy link
Copy Markdown
Member Author

/review

@github-actions github-actions Bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end labels Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds the list_user_credentials Copilot tool with authenticated metadata lookup, bounded managed-credential provisioning, explicit permission handling, updated prompt guidance, typed responses, and dedicated frontend rendering.

Changes

Credential listing flow

Layer / File(s) Summary
Managed credential provisioning contract
autogpt_platform/backend/backend/integrations/managed_credentials.py, autogpt_platform/backend/backend/api/features/integrations/router_test.py
ensure_managed_credentials now returns completion status. Tests cover successful, failed, and empty-provider provisioning.
Backend credential listing
autogpt_platform/backend/backend/copilot/tools/list_credentials.py, autogpt_platform/backend/backend/copilot/tools/models.py, autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
Adds authenticated credential discovery, bounded provisioning, metadata filtering, secret redaction, provider filtering, structured responses, and execution tests.
Copilot availability and guidance
autogpt_platform/backend/backend/copilot/permissions.py, autogpt_platform/backend/backend/copilot/prompting.py, autogpt_platform/backend/backend/copilot/tools/*, autogpt_platform/backend/backend/blocks/autopilot.py, autogpt_platform/backend/backend/blocks/autopilot_permissions_test.py
Registers the tool, adds explicit opt-in permission handling, updates credential workflows, and expands schema coverage.
Frontend parsing and rendering
autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/*, autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/*, autogpt_platform/frontend/src/app/api/openapi.json
Adds response parsing, status messages, credential cards, custom tool routing, API enum support, and UI tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Copilot
  participant ListUserCredentialsTool
  participant CredentialStore
  participant ListCredentialsToolUI
  Copilot->>ListUserCredentialsTool: list_user_credentials(user_id, provider)
  ListUserCredentialsTool->>CredentialStore: provision and retrieve credential metadata
  CredentialStore-->>ListUserCredentialsTool: filtered credential metadata
  ListUserCredentialsTool-->>Copilot: credential_list response
  Copilot->>ListCredentialsToolUI: render tool output
  ListCredentialsToolUI-->>Copilot: display status and credential details
Loading

Possibly related PRs

Suggested reviewers: 0ubbe, majdyz

Poem

A rabbit lists each credential bright,
With secrets hidden out of sight.
Managed checks report their state,
Prompt rules guide the next task’s gate.
UI cards hop into place.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: adding the list_user_credentials CoPilot tool for credential discovery.
Description check ✅ Passed The description directly explains the motivation, implementation, testing, and frontend and backend changes related to credential discovery.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tue-pr-1

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.

@autogpt-pr-reviewer

Copy link
Copy Markdown

Queued a review for PR #13701 at 9d4f464.

@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

🧹 Nitpick comments (1)
autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py (1)

171-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move this import to module scope.

DEFAULT_CREDENTIALS is not a lazy heavy optional dependency, so importing it inside the test violates the backend import rule.

Proposed fix
+from backend.integrations.credentials_store import DEFAULT_CREDENTIALS
+
 ...
 async def test_filters_system_credentials(self, tool, mock_session):
-    from backend.integrations.credentials_store import DEFAULT_CREDENTIALS
-
     creds = [_notion_api_key(), *DEFAULT_CREDENTIALS]

As per coding guidelines, “Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py`
around lines 171 - 172, Move the DEFAULT_CREDENTIALS import from inside
test_filters_system_credentials to the module-level import section, preserving
its existing usage in the test and following the top-level import rule.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@autogpt_platform/backend/backend/copilot/prompting.py`:
- Around line 357-368: Update the rule 0 guidance in the prompting instructions
so a provider absent from list_user_credentials triggers connect_integration
only when CredentialListResponse indicates provisioning_complete=True. When
provisioning is incomplete, do not infer missing credentials or prompt
reconnection; instead attempt the task or wait for an explicit
setup_requirements/insufficient-credential response.

In `@autogpt_platform/backend/backend/copilot/tools/list_credentials.py`:
- Around line 76-149: Split _execute into named helpers for the provisioning
step, credential filtering/transformation, and response-message construction so
_execute remains under 40 lines while preserving the existing error handling,
provider filtering, provisioning warning, and CredentialListResponse behavior.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/tools/ListCredentialsTool/helpers.ts:
- Around line 43-47: Update the output validation helper around the object/type
check to validate the complete ListCredentialsOutput structure before casting:
require the credentials collection and verify every credential item has the
expected fields and valid provider data for downstream provider.split() usage.
Return null for truncated or malformed payloads, and add a test covering
structurally invalid JSON such as an object containing only type.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx:
- Around line 99-112: Update the error-rendering branch in ListCredentialsTool
to use the ErrorCard component. For parsed error output, display output.message;
for output-error without a parsed message, retain “Could not check connected
integrations” as the fallback, while preserving the existing success and
streaming rendering paths.

---

Nitpick comments:
In `@autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py`:
- Around line 171-172: Move the DEFAULT_CREDENTIALS import from inside
test_filters_system_credentials to the module-level import section, preserving
its existing usage in the test and following the top-level import rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ce76977-7343-4ffa-b147-62f2459ad8e8

📥 Commits

Reviewing files that changed from the base of the PR and between bdc2b5f and 9d4f464.

📒 Files selected for processing (13)
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
  • autogpt_platform/frontend/src/app/api/openapi.json
📜 Review details
⏰ Context from checks skipped due to timeout. (15)
  • GitHub Check: lint
  • GitHub Check: integration_test
  • GitHub Check: check API types
  • GitHub Check: Seer Code Review
  • GitHub Check: test (3.11)
  • GitHub Check: type-check (3.12)
  • GitHub Check: test (3.13)
  • GitHub Check: type-check (3.13)
  • GitHub Check: test (3.12)
  • GitHub Check: type-check (3.11)
  • GitHub Check: lint
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (19)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development

Format frontend code using pnpm format

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI
No linter suppressors (// @ts-ignore``, // eslint-disable) — fix the actual issue

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/__generated__/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/
'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development

autogpt_platform/frontend/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components/handlers
No any types unless the value genuinely can be anything
Keep render functions and hooks under ~50 lines; extract named helpers or sub-components when they grow longer

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ following the pattern use{Method}{Version}{OperationName}, and regenerate with pnpm generate:api
Separate render logic from business logic using component.tsx + useComponent.ts + helpers.ts pattern, colocate state when possible and avoid creating large components, use sub-components in local /components folder
Use function declarations for components and handlers, use arrow functions only for callbacks
Do not use useCallback or useMemo unless asked to optimise a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Keep files under ~200 lines; extract sub-components or hooks into their own files when a file grows beyond this
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Always import the -Icon-suffixed alias from @phosphor-icons/react (e.g. TrashIcon, PlusIcon, SquareIcon) — bare exports are deprecated
Do not use useCallback or useMemo unless asked to optimize a given function
Never use src/components/__legacy__/* — use design system components from src/components/

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/**/*.{tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Component props should use interface Props { ... } (not exported) unless the interface needs to be used outside the component

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never type with any, if no types available use unknown

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

autogpt_platform/frontend/**/*.{tsx,jsx}: No dark: Tailwind classes — the design system handles dark mode
Use Next.js <Link> for internal navigation — never raw <a> tags
Use Tailwind CSS only for styling with design tokens and Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Avoid index and barrel files

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

No barrel files or index.ts re-exports in the frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not type hook returns, let Typescript infer as much as possible

autogpt_platform/frontend/src/**/*.ts: Extract component logic into custom hooks grouped by concern, not by component, with each hook in its own .ts file
Do not type hook returns; let TypeScript infer as much as possible

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
autogpt_platform/frontend/src/**/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
autogpt_platform/frontend/src/**/components/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Put sub-components in local components/ folder; component props should be type Props = { ... } (not exported) unless used outside the component

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
autogpt_platform/backend/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development

autogpt_platform/backend/**/*.py: Use poetry run ... command for executing Python package dependencies
Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl
Use absolute imports with from backend.module import ... for cross-package imports; single-dot relative imports are acceptable for sibling modules within the same package; avoid double-dot relative imports
Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead
Use Pydantic models over dataclass/namedtuple/dict for structured data
Do not use linter suppressors — no # type: ignore, # noqa, # pyright: ignore; fix the type/code instead
Prefer list comprehensions over manual loop-and-append patterns
Use early return with guard clauses first to avoid deep nesting
Use %s for deferred interpolation in debug log statements for efficiency; use f-strings elsewhere for readability (e.g., logger.debug("Processing %s items", count) vs logger.info(f"Processing {count} items"))
Sanitize error paths by using os.path.basename() in error messages to avoid leaking directory structure
Be aware of TOCTOU (Time-Of-Check-Time-Of-Use) issues — avoid check-then-act patterns for file access and credit charging
Use transaction=True for Redis pipelines to ensure atomicity on multi-step operations
Use max(0, value) guards for computed values that should never be negative
Keep files under ~300 lines; if a file grows beyond this, split by responsibility (extract helpers, models, or a sub-module into a new file)
Keep functions under ~40 lines; extract named helpers when a function grows longer
...

Files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
autogpt_platform/{backend,autogpt_libs}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Format Python code with poetry run format

Files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
autogpt_platform/backend/**/*_test.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

autogpt_platform/backend/**/*_test.py: Use pytest with snapshot testing for API responses
Colocate test files with source files using *_test.py naming convention
Mock at boundaries — mock where the symbol is used, not where it's defined; after refactoring, update mock targets to match new module paths
Use AsyncMock from unittest.mock for async functions in tests
When writing tests, use Test-Driven Development (TDD): write failing tests marked with @pytest.mark.xfail before implementation, then remove the marker once the implementation is complete
When creating snapshots in tests, use poetry run pytest path/to/test.py --snapshot-update; always review snapshot changes with git diff before committing

Files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}: Use Vitest + RTL + MSW for integration tests as the primary testing approach (~90%, page-level), use Playwright for E2E critical flows, and use Storybook for design system components
Run frontend integration tests with pnpm test:unit (Vitest + RTL + MSW)

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/app/**/__tests__/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Write integration tests in __tests__/ next to page.tsx using Vitest + RTL + MSW for new pages/features

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/__tests__/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Use Orval-generated MSW handlers from @/app/api/__generated__/endpoints/{tag}/{tag}.msw.ts for API mocking

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
🧠 Learnings (31)
📚 Learning: 2026-03-01T07:58:56.207Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/api/openapi.json:10030-10037
Timestamp: 2026-03-01T07:58:56.207Z
Learning: When a backend field represents sensitive data, use a secret type (e.g., Pydantic SecretStr with length constraints) so OpenAPI marks it as a password/writeOnly field. Apply this pattern to similar sensitive request fields across API schemas so generated TypeScript clients and docs treat them as secrets and do not mishandle sensitivity. Review all openapi.jsons where sensitive inputs are defined and replace plain strings with SecretStr-like semantics with appropriate minLength constraints.

Applied to files:

  • autogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-04-14T06:39:49.111Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12773
File: autogpt_platform/frontend/src/app/api/openapi.json:12803-12806
Timestamp: 2026-04-14T06:39:49.111Z
Learning: In OpenAPI specs, ensure the schema/message length caps for the StreamChatRequest.message and QueuePendingMessageRequest.message fields are set to the intended values: StreamChatRequest.message maxLength must be 64000 and QueuePendingMessageRequest.message maxLength must be 32000. Keep QueuePendingMessageRequest.message consistent with PendingMessage.content, and ensure the pending (queue) ceiling never exceeds the stream ceiling because both ultimately feed the same LLM context window. Update any legacy smaller limits (e.g., 4000/16000) to these newer ceilings.

Applied to files:

  • autogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-03-07T07:43:09.871Z
Learnt from: kcze
Repo: Significant-Gravitas/AutoGPT PR: 12328
File: autogpt_platform/frontend/src/app/api/openapi.json:1116-1118
Timestamp: 2026-03-07T07:43:09.871Z
Learning: For autogpt_platform/frontend/src/app/api/openapi.json, preserve the existing behavior: HTTPBearerJWT is declared at the router level with Depends(auth.get_user_id) returning None for unauthenticated users; treat as optional auth. Do not change per-operation security descriptions unless you plan a repo-wide OpenAPI update. If you change this file, prefer clarifying operation descriptions rather than altering security requirements.

Applied to files:

  • autogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-02-27T10:45:49.499Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/(platform)/copilot/tools/RunMCPTool/helpers.tsx:23-24
Timestamp: 2026-02-27T10:45:49.499Z
Learning: Prefer using generated OpenAPI types from '`@/app/api/__generated__/`' for payloads defined in openapi.json (e.g., MCPToolsDiscoveredResponse, MCPToolOutputResponse). Use inline TypeScript interfaces only for payloads that are SSE-stream-only and not exposed via OpenAPI. Apply this pattern to frontend tool components (e.g., RunMCPTool) and related areas where similar SSE/openapi-discrepancies occur; avoid re-implementing types when a generated type is available.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-03-24T02:05:04.672Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12526
File: autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx:0-0
Timestamp: 2026-03-24T02:05:04.672Z
Learning: When gating React component logic on a React Query result (e.g., hooks like `useQuery` / `useGetV2GetCopilotUsage`), prefer destructuring and checking `isSuccess` (or aliasing it to a meaningful boolean like `isSuccess: hasUsage`) instead of relying on `!isLoading`. Reason: `isLoading` can be `false` in error/idle states where `data` may still be `undefined`, while `isSuccess` indicates the query completed successfully and `data` is populated.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-03-24T02:23:31.305Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12526
File: autogpt_platform/frontend/src/app/(platform)/copilot/components/RateLimitResetDialog/RateLimitResetDialog.tsx:0-0
Timestamp: 2026-03-24T02:23:31.305Z
Learning: In the Copilot platform UI code, follow the established Orval hook `onError` error-handling convention: first explicitly detect/handle `ApiError`, then read `error.response?.detail` (if present) as the primary message; if not available, fall back to `error.message`; and finally fall back to a generic string message. This convention should be used for generated Orval hooks even if the custom Orval mutator already maps details into `ApiError.message`, to keep consistency across hooks/components (e.g., `useCronSchedulerDialog.ts`, `useRunGraph.ts`, and rate-limit/reset flows).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
📚 Learning: 2026-03-31T14:04:42.444Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx:172-177
Timestamp: 2026-03-31T14:04:42.444Z
Learning: In the Copilot frontend components under autogpt_platform/frontend/src/app/(platform)/copilot/, Tailwind dark mode variants (e.g., `dark:*`) are intentional and should be allowed. Do not flag `dark:` utilities in these Copilot UI components as incorrect; they are used to ensure proper contrast and correct behavior in both light and dark themes.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-01T18:54:16.035Z
Learnt from: Bentlybro
Repo: Significant-Gravitas/AutoGPT PR: 12633
File: autogpt_platform/frontend/src/app/(platform)/library/components/AgentFilterMenu/AgentFilterMenu.tsx:3-10
Timestamp: 2026-04-01T18:54:16.035Z
Learning: In the frontend, the legacy Select component at `@/components/__legacy__/ui/select` is an intentional, codebase-wide visual-consistency pattern. During code reviews, do not flag or block PRs merely for continuing to use this legacy Select. If a migration to the newer design-system Select is desired, bundle it into a single dedicated cleanup/migration PR that updates all Select usages together (e.g., avoid piecemeal replacements).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
📚 Learning: 2026-04-07T09:24:16.582Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12686
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx:1-19
Timestamp: 2026-04-07T09:24:16.582Z
Learning: In Significant-Gravitas/AutoGPT’s `autogpt_platform/frontend` (Vite + `vitejs/plugin-react` with the automatic JSX transform), do not flag usages of React types/components (e.g., `React.ReactNode`) in `.ts`/`.tsx` files as missing `React` imports. Since the React namespace is made available by the project’s TS/Vite setup, an explicit `import React from 'react'` or `import type { ReactNode } ...` is not required; only treat it as missing if typechecking (e.g., `pnpm types`) would actually fail.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
📚 Learning: 2026-04-02T05:43:49.128Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12640
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/WelcomeStep.tsx:13-13
Timestamp: 2026-04-02T05:43:49.128Z
Learning: Do not flag `import { Question } from "phosphor-icons/react"` as an invalid import. `Question` is a valid named export from `phosphor-icons/react` (as reflected in the package’s generated `.d.ts` files and re-exports via `dist/index.d.ts`), so it should be treated as a supported named export during code reviews.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
📚 Learning: 2026-04-13T13:11:07.445Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12764
File: autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsx:143-145
Timestamp: 2026-04-13T13:11:07.445Z
Learning: In `autogpt_platform/frontend`, do not flag direct interpolation of `executionID` UUID strings into URL query parameters (e.g., `activeItem=${executionID}` in JSX/Next links). If the value is a UUID string matching `[0-9a-f-]`, it contains no reserved URL characters, so additional `encodeURIComponent` or Next.js object-based `href` encoding is unnecessary. Only treat it as an encoding issue if the query-param value is not guaranteed to be UUID-formatted (i.e., may include characters outside `[0-9a-f-]`).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-15T22:49:06.896Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11235
File: autogpt_platform/frontend/src/app/(platform)/admin/diagnostics/components/ExecutionsTable.tsx:0-0
Timestamp: 2026-04-15T22:49:06.896Z
Learning: In the AutoGPT frontend (React Query + toast/ErrorCard patterns), do not require `Sentry.captureException` in React Query mutation `catch` blocks. React Query handles error propagation for mutation paths, so follow the established pattern: show toast notifications for mutation errors and use `ErrorCard` for render/fetch errors. Only add `Sentry.captureException` for truly manual/unexpected exception paths that are outside React Query’s control (e.g., standalone async utilities or event handlers not wired through React Query).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-07-03T04:19:11.799Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13474
File: autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx:38-38
Timestamp: 2026-07-03T04:19:11.799Z
Learning: When reviewing Tailwind usage in .tsx components, allow intentional raw hex color values if they exactly match the design-spec and there is no equivalent Tailwind design token/utility class available (e.g., a utility like `bg-zinc-50` may be a different shade than the required `#f9f9f9`). Do not flag these as "design-token violations" as long as the reviewer can confirm that an appropriate Tailwind token does not exist or would not match the exact color.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-04T08:04:35.881Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12273
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:216-220
Timestamp: 2026-03-04T08:04:35.881Z
Learning: In the AutoGPT Copilot backend, ensure that SVG images are not treated as vision image types by excluding 'image/svg+xml' from INLINEABLE_MIME_TYPES and MULTIMODAL_TYPES in tool_adapter.py; the Claude API supports PNG, JPEG, GIF, and WebP for vision. SVGs (XML text) should be handled via the text path instead, not the vision path.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-01T04:17:41.600Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12632
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-01T04:17:41.600Z
Learning: When reviewing AutoGPT Copilot tool implementations, accept that `readOnlyHint=True` (provided via `ToolAnnotations`) may be applied unconditionally to *all* tools—even tools that have side effects (e.g., `bash_exec`, `write_workspace_file`, or other write/save operations). Do **not** flag these tools for having `readOnlyHint=True`; this is intentional to enable fully-parallel dispatch by the Anthropic SDK/CLI and has been E2E validated. Only flag `readOnlyHint` issues if they conflict with the established `ToolAnnotations` behavior (e.g., missing/incorrect propagation relative to the intended annotation mechanism).

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-06-06T12:22:37.648Z
Learnt from: anvyle
Repo: Significant-Gravitas/AutoGPT PR: 13302
File: autogpt_platform/backend/backend/copilot/tools/agent_search.py:579-583
Timestamp: 2026-06-06T12:22:37.648Z
Learning: When writing LLM-facing instruction strings that trigger tool calls in this AutoGPT codebase, use the exact registered tool name `view_agent_output` (as defined in `backend/copilot/tools/agent_output.py` via its `name` property and exported via `TOOL_REGISTRY`). Do not reference the bare name `agent_output`, since it is not a valid tool name and will cause tool invocation to fail.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-04T12:19:39.243Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12279
File: autogpt_platform/backend/backend/copilot/tools/base.py:184-188
Timestamp: 2026-03-04T12:19:39.243Z
Learning: In autogpt_platform/backend/backend/copilot/tools/, ensure that anonymous users always pass user_id=None to tool execution methods. The anon_ prefix (e.g., anon_123) is used only for PostHog/analytics distinct_id and must not be used as an actual user_id. Use a simple truthiness check on user_id (e.g., if user_id: ... else: ... or a dedicated is_authenticated flag) to distinguish anonymous from authenticated users, and review all tool execution call sites within this directory to prevent accidentally forwarding an anon_ user_id to tools.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-31T14:22:26.566Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12622
File: autogpt_platform/backend/backend/copilot/tools/agent_search.py:223-236
Timestamp: 2026-03-31T14:22:26.566Z
Learning: In files under autogpt_platform/backend/backend/copilot/tools/, ensure agent graph enrichment uses the typed Pydantic model `backend.data.graph.Graph` for `AgentInfo.graph` (i.e., `Graph | None`), not `dict[str, Any]`. When enriching with graph data (e.g., `_enrich_agents_with_graph`), prefer calling `graph_db().get_graph(graph_id, version=None, user_id=user_id)` directly to retrieve the typed `Graph` object rather than routing through JSON conversions like `get_agent_as_json()` / `graph_to_json()`.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-05T15:42:08.207Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12297
File: .claude/skills/backend-check/SKILL.md:14-16
Timestamp: 2026-03-05T15:42:08.207Z
Learning: In Python files under autogpt_platform/backend (recursively), rely on poetry run format to perform formatting (Black + isort) and linting (ruff). Do not run poetry run lint as a separate step after poetry run format, since format already includes linting checks.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-16T16:35:40.236Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12440
File: autogpt_platform/backend/backend/api/features/workflow_import.py:54-63
Timestamp: 2026-03-16T16:35:40.236Z
Learning: Avoid using the word 'competitor' in public-facing identifiers and text. Use neutral naming for API paths, model names, function names, and UI text. Examples: rename 'CompetitorFormat' to 'SourcePlatform', 'convert_competitor_workflow' to 'convert_workflow', '/competitor-workflow' to '/workflow'. Apply this guideline to files under autogpt_platform/backend and autogpt_platform/frontend.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-31T15:37:38.626Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/backend/backend/copilot/tools/agent_generator/fixer.py:37-47
Timestamp: 2026-03-31T15:37:38.626Z
Learning: When validating/constructing Anthropic API model IDs in Significant-Gravitas/AutoGPT, allow the hyphen-separated Claude Opus 4.6 model ID `claude-opus-4-6` (it corresponds to `LlmModel.CLAUDE_4_6_OPUS` in `autogpt_platform/backend/backend/blocks/llm.py`). Do NOT require the dot-separated form in Anthropic contexts. Only OpenRouter routing variants should use the dot separator (e.g., `anthropic/claude-opus-4.6`); `claude-opus-4-6` should be treated as correct when passed to Anthropic, and flagged only if it’s used in the OpenRouter path where the dot form is expected.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-15T02:43:36.890Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12780
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-15T02:43:36.890Z
Learning: When reviewing Python exception handlers, do not flag `isinstance(e, X)` checks as dead/unreachable if the caught exception `X` is a subclass of the exception type being handled. For example, if `X` (e.g., `VirusScanError`) inherits from `ValueError` (directly or via an intermediate class) and it can be raised within an `except ValueError:` block, then `isinstance(e, X)` inside that handler is reachable and should not be treated as dead code.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-05-23T05:29:43.085Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13200
File: autogpt_platform/backend/backend/executor/scheduler.py:590-593
Timestamp: 2026-05-23T05:29:43.085Z
Learning: When reviewing Python code that uses Pydantic discriminated/tagged unions (e.g., `Annotated[Union[...], Field(discriminator="kind")]`), recognize that using `isinstance(x, SomeVariantInfo)` to narrow the union is an intentional and correct runtime guard and should also enable static type narrowing in tools like Pyright. Do not recommend replacing such `isinstance`-based narrowing with `cast(...)` when the check already proves the variant at runtime.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-22T11:46:04.431Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/config.py:0-0
Timestamp: 2026-04-22T11:46:04.431Z
Learning: Do not flag the Claude Sonnet 4.6 model ID as incorrect when it uses the project’s established hyphenated convention: `anthropic/claude-sonnet-4-6`. This hyphen form is the intentional, production convention and should be treated as valid (including in files like llm.py, blocks tests, reasoning.py, `_is_anthropic_model` tests, and config defaults). Note that OpenRouter also accepts the dot variant `anthropic/claude-sonnet-4.6`, so either form may be tolerated, but `anthropic/claude-sonnet-4-6` should be considered the standard to match project usage.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-22T11:46:12.892Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/baseline/service.py:322-332
Timestamp: 2026-04-22T11:46:12.892Z
Learning: In this codebase (Significant-Gravitas/AutoGPT), OpenRouter-routed Anthropic model IDs should use the hyphen-separated convention (e.g., `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-6`). Although OpenRouter may accept both hyphen and dot variants, treat the hyphen-separated form as the intended, correct codebase-wide convention and do not flag it as an error. Only flag the dot-separated variant (e.g., `anthropic/claude-sonnet-4.6`) as incorrect when reviewing/validating model ID strings for OpenRouter-routed Anthropic models.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-05-07T18:48:14.242Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13040
File: autogpt_platform/backend/backend/blocks/llm.py:0-0
Timestamp: 2026-05-07T18:48:14.242Z
Learning: In this repository, isort may split imports from the same module into separate blocks when some imports are aliased (e.g., `from module import X as Y`) and others are not. Preserve the two-block layout when it results from isort (such as keeping `from openai.types.chat import ChatCompletion as OpenAIChatCompletion` separate from non-aliased imports from `openai.types.chat`). Do not treat that split as a style issue during review; merging them into a single block can fail CI with `Imports are incorrectly sorted and/or formatted`.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-05-26T14:24:34.866Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13217
File: autogpt_platform/backend/backend/api/features/search/service.py:137-137
Timestamp: 2026-05-26T14:24:34.866Z
Learning: In the Significant-Gravitas/AutoGPT backend, treat `user_id` (an opaque UUID used only for correlation/tracing) as non-PII. Do not flag direct logging of `user_id` in `logger.warning`/`logger.info` statements as a PII exposure issue, as the established convention is to log `user_id` for tracing while reserving PII for fields like email or display name.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-06-11T19:39:10.493Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 13337
File: autogpt_platform/backend/backend/copilot/graphiti/reranker.py:0-0
Timestamp: 2026-06-11T19:39:10.493Z
Learning: In the Significant-Gravitas/AutoGPT Python backend, when calling the OpenAI Python client `chat.completions.create`, construct the `messages` payload using the concrete typed-dict variants from `openai.types.chat` (e.g., `ChatCompletionSystemMessageParam`, `ChatCompletionUserMessageParam`, etc.) rather than trying to instantiate `ChatCompletionMessageParam` directly. `ChatCompletionMessageParam` is a `Union` alias and is not constructible, so `ChatCompletionMessageParam(role=..., content=...)` should fail type checking. Build each message element with the appropriate concrete typed dict and then annotate the resulting list as `list[ChatCompletionMessageParam]` (e.g., `messages: list[ChatCompletionMessageParam] = [ChatCompletionSystemMessageParam(...), ...]`).

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-20T13:17:39.951Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12854
File: autogpt_platform/frontend/src/app/(platform)/library/__tests__/briefing.test.tsx:84-84
Timestamp: 2026-04-20T13:17:39.951Z
Learning: In the AutoGPT frontend, `testing-library/react` cleanup is already handled globally after each test via `src/tests/integrations/vitest.setup.tsx`. Therefore, for integration test files under `__tests__/`, do NOT add redundant `afterEach(() => cleanup())`. Only add local `afterEach` teardown for resources that are not covered globally—specifically, when using fake timers, add `afterEach(() => vi.useRealTimers())` (or equivalent) to restore real timers and prevent cross-test interference.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-20T20:07:22.981Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11235
File: autogpt_platform/frontend/src/app/(platform)/admin/diagnostics/__tests__/ExecutionsTable.test.tsx:27-76
Timestamp: 2026-04-20T20:07:22.981Z
Learning: In this codebase, Orval-generated API modules under `src/app/api/__generated__/` are not committed to git and must be generated via `pnpm generate:api` (requires a running backend). In integration tests, it’s acceptable—and expected—to stub generated hooks/modules by mocking them with `vi.mock("`@/app/api/__generated__/endpoints/`{tag}/{tag}")`. Do not treat `vi.mock` of these generated hook modules as a violation of the MSW handler guideline, since the corresponding MSW handlers cannot be imported at test time when generated files are absent.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
🔇 Additional comments (13)
autogpt_platform/backend/backend/copilot/tools/models.py (1)

126-127: LGTM!

autogpt_platform/backend/backend/copilot/tools/list_credentials.py (1)

1-74: LGTM!

Also applies to: 152-173

autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py (1)

1-168: LGTM!

Also applies to: 174-261

autogpt_platform/backend/backend/copilot/permissions.py (1)

107-107: LGTM!

autogpt_platform/backend/backend/copilot/tools/__init__.py (1)

37-37: LGTM!

Also applies to: 141-142

autogpt_platform/backend/backend/copilot/prompting.py (1)

184-184: LGTM!

Also applies to: 433-443

autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py (1)

100-105: LGTM!

autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts (1)

1-42: LGTM!

Also applies to: 48-111

autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx (1)

1-98: LGTM!

Also applies to: 102-138

autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx (1)

20-20: LGTM!

Also applies to: 214-215

autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts (1)

43-43: LGTM!

autogpt_platform/frontend/src/app/api/openapi.json (1)

20800-20801: LGTM!

autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx (1)

1-163: LGTM!

Comment thread autogpt_platform/backend/backend/copilot/prompting.py
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
Add direct tests for _ensure_managed_credentials_bounded covering the
timeout and generic-exception paths, which the autouse wrapper stub
otherwise short-circuits.
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.30612% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.55%. Comparing base (f6b98c5) to head (8e05170).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #13701      +/-   ##
==========================================
+ Coverage   78.53%   78.55%   +0.01%     
==========================================
  Files        2986     2990       +4     
  Lines      228840   229318     +478     
  Branches    21526    21716     +190     
==========================================
+ Hits       179720   180136     +416     
- Misses      44231    44276      +45     
- Partials     4889     4906      +17     
Flag Coverage Δ
platform-backend 84.28% <98.09%> (+0.03%) ⬆️
platform-frontend 53.48% <81.15%> (+0.04%) ⬆️
platform-frontend-e2e 29.71% <0.00%> (-0.55%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Platform Backend 84.28% <98.09%> (+0.03%) ⬆️
Platform Frontend 56.36% <78.87%> (-0.10%) ⬇️
AutoGPT Libs ∅ <ø> (∅)
Classic AutoGPT 28.43% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Reword rule 1 so the 'Surface the sign-in card EAGERLY' phrase stays
contiguous, satisfying the TestCredentialsSurfacingGuardrails guardrail
on dev while preserving the new rule-0 (check-first) conditioning.

@autogpt-pr-reviewer autogpt-pr-reviewer 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.

📋 Automated Review — PR #13701

PR #13701 — feat(platform): add list_user_credentials CoPilot tool for credential discovery
Author: Abhi1992002 | Files: 13

🎯 Verdict: APPROVE (with should-fix follow-ups)

PR Description Quality

✅ Has Why + What + How — the description documents the security-sensitive decision (secret-free serialization reuse of to_meta_response), the caching trade-off rationale (on-demand tool vs. per-user prompt injection), and the char-budget bump with a documented convention. This is high-quality self-review.

What This PR Does

Adds a list_user_credentials CoPilot tool so the assistant can discover which integrations a user has already connected (returning metadata only — id, provider, type, title, scopes, username, host, is_managed — never secrets) with an optional provider filter. It wires up the backend tool, response model, permission/registry entries, system-prompt guidance to check connections before surfacing sign-in cards, and a frontend chat card that renders the connected integrations in an accordion. The goal is to stop the CoPilot from prompting users to sign into things they're already connected to.

Specialist Findings

🛡️ Security ✅ — Metadata-only, auth-enforced (twice: requires_auth=True + defensive if not user_id), and user-scoped via get_all_creds(user_id). Reuses the vetted to_meta_response allowlist serializer rather than reinventing secret-stripping; tests assert secret strings are absent. It is more restrictive than the existing GET /credentials endpoint (also filters SYSTEM_CREDENTIAL_IDS). No secret/tenancy findings.
🟡 A tool described as read-only invokes ensure_managed_credentials(), a provisioning write side-effect now LLM-triggerable (list_credentials.py:157). Low risk — mirrors GET /credentials, 10s-bounded, upstream idempotency guard.

🏗️ Architecture ⚠️ — Well-scoped feature, but imports CredentialsMetaResponse/to_meta_response from the FastAPI router module (list_credentials.py:7) — the first copilot tool to depend on the transport layer for pure serialization concerns. Also duplicates the router's bounded managed-sweep helper with a behavioral divergence.
🟠 _ensure_managed_credentials_bounded (list_credentials.py:148) duplicates router.py:260 but diverges: the router schedules a background task to finish provisioning on timeout; this copy just returns False, so repeat calls re-run the full 10s sweep.

Performance ⚠️ — Well-bounded overall (get_all_creds is a single batched fetch over a small per-user set; SYSTEM_CREDENTIAL_IDS is O(1); sweep is TTLCache-guarded to once/user/pod/hour). But the managed sweep runs unconditionally even when provider filters to a never-managed provider (github/google/notion), adding up to 10s of wasted work on a prompt-designated hot path (list_credentials.py:118).

🧪 Testing ⚠️ — Genuinely strong: 17 backend + 7 frontend tests with secret-aware assertions, provider filtering, whitespace, system/SDK-default filtering, and both error paths covered. Two real gaps: the bounded-sweep resiliency wrapper is stubbed by an autouse fixture so its timeout/exception branches never execute, and managed-credential inclusion (is_managed=True) has no backend guard.

📖 Quality ✅ — Readability A-. Clear naming, docstrings, rationale comments. Minor nits: a redundant render guard, a per-call manager instance, and a pre-existing duplicate set entry in the block being edited.

📦 Product ✅ — Matches REQ-112 with solid loading/empty/error states. Up-to-10s latency on the discovery path (same root cause as Performance) and a few FE polish items (http provider label, unbounded scope list).

📬 Discussion ⚠️ — GitHub API auth failed (HTTP 401: Bad credentials); live CI status, merge conflicts, and review threads could not be fetched. Author's checklist is fully filled with a credible test plan. GitHub CI: UNVERIFIED.

🔎 QA ✅ — Exercised end-to-end against a live docker stack: tool invoked via copilot stream, count 0 with ollama correctly filtered, count 1 after adding a real Notion key, secret secret_notion_TESTVALUE_123 grep count 0 in output, provider filter (github → 0), unauthenticated → 401, and the frontend ListCredentialsTool accordion rendered "🔑 Notion / API key · My Notion Key". Could not reproduce the incomplete-provisioning path live (managed sweep succeeded).

🟠 Should Fix

  1. Managed sweep runs on the hot path even for non-managed providers (list_credentials.py:118) — Prompt rule 0 makes this a high-frequency, user-facing call; first-of-hour calls can stall up to 10s doing provisioning work the provider filter discards. Gate the sweep on managed-provider relevance (skip + return provisioning_complete=True when provider is set and not in managed_credentials._PROVIDERS). (Flagged by: performance, product — 2 specialists)
  2. Untested resiliency wrapper (list_credentials.py:158) — The autouse fixture stub_managed_credentials_sweep patches the entire function, so the TimeoutError → False and generic except → False branches — the tool's whole safety claim — never run. A regression that hung the turn or returned True on failure would pass CI. Make the stub opt-in and add direct timeout/exception/success tests. (Flagged by: testing — high severity)
  3. Duplicated bounded-sweep helper with divergence (list_credentials.py:148 vs router.py:260) — Extract one shared helper in the integrations layer returning a completion status; the current copy loses the router's background-completion behavior. (Flagged by: architect)
  4. Router-layer import for serialization (list_credentials.py:7) — Move CredentialsMetaResponse/to_meta_response into integrations/model.py and import from the domain layer in both router and tool, removing transport-layer coupling. (Flagged by: architect)
  5. No backend guard for managed-credential inclusion (list_credentials_test.py:187) — Add a test asserting a managed credential yields count == 1 and is_managed is True; the PR explicitly relies on managed creds not being filtered. (Flagged by: testing)

🟡 Nice to Have

  1. Filter before serialize (list_credentials.py:130) — Filter all_creds by provider before calling to_meta_response. Free reordering; small win. (performance)
  2. Shared IntegrationCredentialsManager (list_credentials.py:156) — Reuse a module-level manager as the router does, instead of two instances per call. (architect, quality — 2 specialists)
  3. Surface provisioning_complete=false in the card (helpers.ts / ListCredentialsTool.tsx:108) — Add the field to CredentialListOutput and show a "list may be incomplete" hint when set. (product, ui-reviewer — 2 specialists)
  4. Host-scoped label reads "Http" (ListCredentialsTool.tsx:70) — Use the host as the card title for host-scoped creds. (product)

🔵 Nits

  1. Redundant render guard (ListCredentialsTool.tsx:108) — hasContent && output && isCredentialList(output) re-checks conditions folded into hasContent; collapse into one narrowed value. (quality)
  2. Pre-existing duplicate set entry (ChatMessagesContainer/helpers.ts:43) — CUSTOM_TOOL_TYPES contains tool-connect_integration twice; harmless in a Set, cheap to drop while editing this block. (quality, discussion)
  3. Unbounded scope list (ListCredentialsTool.tsx:96) — Cap displayed scopes with "+N more". (product)
  4. Link FE types to backend source of truth (helpers.ts:3) — Comment referencing CredentialsMetaResponse. (quality)

QA Screenshots

Screenshot Description
copilot empty state Authenticated copilot empty state ✅
assistant response with tool card Assistant response invoking the tool ✅
ListCredentialsTool expanded Expanded accordion: 🔑 Notion / "API key · My Notion Key" ✅

Human Review Needed

YES — This introduces a new trust boundary: the CoPilot LLM can now enumerate a user's connected-credential metadata on demand. Security reviewed it as low-risk (metadata-only, reuses the vetted secret-stripping serializer, more restrictive than the existing endpoint), but a human should confirm the exposure scope is intended before merge.

Risk Assessment

Merge risk: LOW | Rollback: EASY (additive, isolated new tool + renderer; no schema/migration changes)

CI Status

Local harness: lint (frontend + backend), typecheck, and build all pass; pnpm test:unit (frontend) failed in the sandbox — this suite is environment-sensitive here and the failure could not be attributed to this PR's code, so treat as environment skew pending live verification. GitHub CI: UNVERIFIED — the review bot's token returned HTTP 401; live CI, merge-conflict, and review-thread status must be confirmed manually before merge.


UI Testing — Variant Results

✅ local: list_user_credentials tool works end-to-end: correct filtering, no secret leakage, working provider filter and auth guard, and the frontend card renders connected integrations correctly.

  • low: CredentialListOutput interface omits the backend's provisioning_complete field, and the card only shows message (which carries the provisioning-incomplete warning) in the empty-credentials branch. When provisioning is incomplete but credentials exist, the warning is not surfaced in the UI card (model still receives it in tool text).

✅ hosted: list_user_credentials tool verified end-to-end: registered, returns secret-free metadata, filters system/SDK creds (1 of 2 returned), provider filter + auth guard work, model invokes it, and the frontend card renders correctly.

Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py Outdated
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py Outdated
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
…ndering & split _execute

- prompting: instruct the model not to treat absence as authoritative when
  provisioning_complete=false
- list_credentials: extract _serialize_connected_credentials and
  _build_inventory_message so _execute stays orchestration-only
- frontend helpers: validate the tool payload shape (require a credentials
  array, coerce providers/count) so a truncated event can't crash the chat
- frontend card: render tool failures via ToolErrorCard with the returned
  message instead of only a status line
- tests: cover the error card and the malformed-payload guard; hoist
  DEFAULT_CREDENTIALS import to module scope
…lters

Address review feedback:
- skip the up-to-10s managed-credential sweep when the provider filter is a
  provider that is never managed, keeping the common discovery path off the
  hot path
- serialize credentials only after the provider/system/SDK-default filter
- surface provisioning_complete in the chat card (incomplete-list hint)
- simplify the render guard; document the frontend types mirror the backend
  response; drop a stray duplicate CUSTOM_TOOL_TYPES entry
- tests: managed creds are included and flagged, sweep-skip path, object
  payload branch, incomplete-provisioning hint

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py`:
- Around line 206-220: Update test_skips_managed_sweep_for_non_managed_provider
to remove the get_managed_provider patch and invoke the real managed-provider
registry lookup. Use a provider value known to be non-managed in that registry,
while preserving the existing credential mock and assertions that provisioning
completes and stub_managed_credentials_sweep is not awaited.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f238b995-4c13-49ac-8649-bdfc5ed74729

📥 Commits

Reviewing files that changed from the base of the PR and between 69d8b1d and e5bedcc.

📒 Files selected for processing (7)
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
💤 Files with no reviewable changes (1)
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (17)
  • GitHub Check: check API types
  • GitHub Check: lint
  • GitHub Check: integration_test
  • GitHub Check: end-to-end tests
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.13)
  • GitHub Check: lint
  • GitHub Check: type-check (3.12)
  • GitHub Check: test (3.12)
  • GitHub Check: type-check (3.13)
  • GitHub Check: type-check (3.11)
  • GitHub Check: Seer Code Review
  • GitHub Check: lint
  • GitHub Check: types
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Analyze (python)
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (15)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development

Format frontend code using pnpm format

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI
No linter suppressors (// @ts-ignore``, // eslint-disable) — fix the actual issue

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/__generated__/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/
'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development

autogpt_platform/frontend/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components/handlers
No any types unless the value genuinely can be anything
Keep render functions and hooks under ~50 lines; extract named helpers or sub-components when they grow longer

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ following the pattern use{Method}{Version}{OperationName}, and regenerate with pnpm generate:api
Separate render logic from business logic using component.tsx + useComponent.ts + helpers.ts pattern, colocate state when possible and avoid creating large components, use sub-components in local /components folder
Use function declarations for components and handlers, use arrow functions only for callbacks
Do not use useCallback or useMemo unless asked to optimise a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Keep files under ~200 lines; extract sub-components or hooks into their own files when a file grows beyond this
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Always import the -Icon-suffixed alias from @phosphor-icons/react (e.g. TrashIcon, PlusIcon, SquareIcon) — bare exports are deprecated
Do not use useCallback or useMemo unless asked to optimize a given function
Never use src/components/__legacy__/* — use design system components from src/components/

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/**/*.{tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Component props should use interface Props { ... } (not exported) unless the interface needs to be used outside the component

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never type with any, if no types available use unknown

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}: Use Vitest + RTL + MSW for integration tests as the primary testing approach (~90%, page-level), use Playwright for E2E critical flows, and use Storybook for design system components
Run frontend integration tests with pnpm test:unit (Vitest + RTL + MSW)

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

autogpt_platform/frontend/**/*.{tsx,jsx}: No dark: Tailwind classes — the design system handles dark mode
Use Next.js <Link> for internal navigation — never raw <a> tags
Use Tailwind CSS only for styling with design tokens and Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/app/**/__tests__/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Write integration tests in __tests__/ next to page.tsx using Vitest + RTL + MSW for new pages/features

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/__tests__/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Use Orval-generated MSW handlers from @/app/api/__generated__/endpoints/{tag}/{tag}.msw.ts for API mocking

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/AGENTS.md)

Avoid index and barrel files

Files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
autogpt_platform/backend/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development

autogpt_platform/backend/**/*.py: Use poetry run ... command for executing Python package dependencies
Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl
Use absolute imports with from backend.module import ... for cross-package imports; single-dot relative imports are acceptable for sibling modules within the same package; avoid double-dot relative imports
Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead
Use Pydantic models over dataclass/namedtuple/dict for structured data
Do not use linter suppressors — no # type: ignore, # noqa, # pyright: ignore; fix the type/code instead
Prefer list comprehensions over manual loop-and-append patterns
Use early return with guard clauses first to avoid deep nesting
Use %s for deferred interpolation in debug log statements for efficiency; use f-strings elsewhere for readability (e.g., logger.debug("Processing %s items", count) vs logger.info(f"Processing {count} items"))
Sanitize error paths by using os.path.basename() in error messages to avoid leaking directory structure
Be aware of TOCTOU (Time-Of-Check-Time-Of-Use) issues — avoid check-then-act patterns for file access and credit charging
Use transaction=True for Redis pipelines to ensure atomicity on multi-step operations
Use max(0, value) guards for computed values that should never be negative
Keep files under ~300 lines; if a file grows beyond this, split by responsibility (extract helpers, models, or a sub-module into a new file)
Keep functions under ~40 lines; extract named helpers when a function grows longer
...

Files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
autogpt_platform/{backend,autogpt_libs}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Format Python code with poetry run format

Files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
autogpt_platform/backend/**/*_test.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

autogpt_platform/backend/**/*_test.py: Use pytest with snapshot testing for API responses
Colocate test files with source files using *_test.py naming convention
Mock at boundaries — mock where the symbol is used, not where it's defined; after refactoring, update mock targets to match new module paths
Use AsyncMock from unittest.mock for async functions in tests
When writing tests, use Test-Driven Development (TDD): write failing tests marked with @pytest.mark.xfail before implementation, then remove the marker once the implementation is complete
When creating snapshots in tests, use poetry run pytest path/to/test.py --snapshot-update; always review snapshot changes with git diff before committing

Files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
🧠 Learnings (29)
📚 Learning: 2026-02-27T10:45:49.499Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/(platform)/copilot/tools/RunMCPTool/helpers.tsx:23-24
Timestamp: 2026-02-27T10:45:49.499Z
Learning: Prefer using generated OpenAPI types from '`@/app/api/__generated__/`' for payloads defined in openapi.json (e.g., MCPToolsDiscoveredResponse, MCPToolOutputResponse). Use inline TypeScript interfaces only for payloads that are SSE-stream-only and not exposed via OpenAPI. Apply this pattern to frontend tool components (e.g., RunMCPTool) and related areas where similar SSE/openapi-discrepancies occur; avoid re-implementing types when a generated type is available.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-03-24T02:05:04.672Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12526
File: autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx:0-0
Timestamp: 2026-03-24T02:05:04.672Z
Learning: When gating React component logic on a React Query result (e.g., hooks like `useQuery` / `useGetV2GetCopilotUsage`), prefer destructuring and checking `isSuccess` (or aliasing it to a meaningful boolean like `isSuccess: hasUsage`) instead of relying on `!isLoading`. Reason: `isLoading` can be `false` in error/idle states where `data` may still be `undefined`, while `isSuccess` indicates the query completed successfully and `data` is populated.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-03-24T02:23:31.305Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12526
File: autogpt_platform/frontend/src/app/(platform)/copilot/components/RateLimitResetDialog/RateLimitResetDialog.tsx:0-0
Timestamp: 2026-03-24T02:23:31.305Z
Learning: In the Copilot platform UI code, follow the established Orval hook `onError` error-handling convention: first explicitly detect/handle `ApiError`, then read `error.response?.detail` (if present) as the primary message; if not available, fall back to `error.message`; and finally fall back to a generic string message. This convention should be used for generated Orval hooks even if the custom Orval mutator already maps details into `ApiError.message`, to keep consistency across hooks/components (e.g., `useCronSchedulerDialog.ts`, `useRunGraph.ts`, and rate-limit/reset flows).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-03-31T14:04:42.444Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx:172-177
Timestamp: 2026-03-31T14:04:42.444Z
Learning: In the Copilot frontend components under autogpt_platform/frontend/src/app/(platform)/copilot/, Tailwind dark mode variants (e.g., `dark:*`) are intentional and should be allowed. Do not flag `dark:` utilities in these Copilot UI components as incorrect; they are used to ensure proper contrast and correct behavior in both light and dark themes.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-01T18:54:16.035Z
Learnt from: Bentlybro
Repo: Significant-Gravitas/AutoGPT PR: 12633
File: autogpt_platform/frontend/src/app/(platform)/library/components/AgentFilterMenu/AgentFilterMenu.tsx:3-10
Timestamp: 2026-04-01T18:54:16.035Z
Learning: In the frontend, the legacy Select component at `@/components/__legacy__/ui/select` is an intentional, codebase-wide visual-consistency pattern. During code reviews, do not flag or block PRs merely for continuing to use this legacy Select. If a migration to the newer design-system Select is desired, bundle it into a single dedicated cleanup/migration PR that updates all Select usages together (e.g., avoid piecemeal replacements).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-07T09:24:16.582Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12686
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx:1-19
Timestamp: 2026-04-07T09:24:16.582Z
Learning: In Significant-Gravitas/AutoGPT’s `autogpt_platform/frontend` (Vite + `vitejs/plugin-react` with the automatic JSX transform), do not flag usages of React types/components (e.g., `React.ReactNode`) in `.ts`/`.tsx` files as missing `React` imports. Since the React namespace is made available by the project’s TS/Vite setup, an explicit `import React from 'react'` or `import type { ReactNode } ...` is not required; only treat it as missing if typechecking (e.g., `pnpm types`) would actually fail.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-07-28T15:32:54.931Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13699
File: autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletFullPanel.tsx:0-0
Timestamp: 2026-07-28T15:32:54.931Z
Learning: In AutoGPT's frontend (autogpt_platform/frontend), prefer importing the non-legacy ScrollArea component from `@/components/ui/scroll-area` over `@/components/__legacy__/ui/scroll-area` for new or migrated code. The non-legacy component is a drop-in superset: it preserves the legacy component’s props and additionally supports the optional `showScrollToTop` prop—so reviewers should flag new legacy imports unless there’s a specific, documented reason they can’t use the non-legacy version.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-02T05:43:49.128Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12640
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/WelcomeStep.tsx:13-13
Timestamp: 2026-04-02T05:43:49.128Z
Learning: Do not flag `import { Question } from "phosphor-icons/react"` as an invalid import. `Question` is a valid named export from `phosphor-icons/react` (as reflected in the package’s generated `.d.ts` files and re-exports via `dist/index.d.ts`), so it should be treated as a supported named export during code reviews.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-13T13:11:07.445Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12764
File: autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsx:143-145
Timestamp: 2026-04-13T13:11:07.445Z
Learning: In `autogpt_platform/frontend`, do not flag direct interpolation of `executionID` UUID strings into URL query parameters (e.g., `activeItem=${executionID}` in JSX/Next links). If the value is a UUID string matching `[0-9a-f-]`, it contains no reserved URL characters, so additional `encodeURIComponent` or Next.js object-based `href` encoding is unnecessary. Only treat it as an encoding issue if the query-param value is not guaranteed to be UUID-formatted (i.e., may include characters outside `[0-9a-f-]`).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-15T22:49:06.896Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11235
File: autogpt_platform/frontend/src/app/(platform)/admin/diagnostics/components/ExecutionsTable.tsx:0-0
Timestamp: 2026-04-15T22:49:06.896Z
Learning: In the AutoGPT frontend (React Query + toast/ErrorCard patterns), do not require `Sentry.captureException` in React Query mutation `catch` blocks. React Query handles error propagation for mutation paths, so follow the established pattern: show toast notifications for mutation errors and use `ErrorCard` for render/fetch errors. Only add `Sentry.captureException` for truly manual/unexpected exception paths that are outside React Query’s control (e.g., standalone async utilities or event handlers not wired through React Query).

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-07-03T04:19:11.799Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13474
File: autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx:38-38
Timestamp: 2026-07-03T04:19:11.799Z
Learning: When reviewing Tailwind usage in .tsx components, allow intentional raw hex color values if they exactly match the design-spec and there is no equivalent Tailwind design token/utility class available (e.g., a utility like `bg-zinc-50` may be a different shade than the required `#f9f9f9`). Do not flag these as "design-token violations" as long as the reviewer can confirm that an appropriate Tailwind token does not exist or would not match the exact color.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-20T13:17:39.951Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12854
File: autogpt_platform/frontend/src/app/(platform)/library/__tests__/briefing.test.tsx:84-84
Timestamp: 2026-04-20T13:17:39.951Z
Learning: In the AutoGPT frontend, `testing-library/react` cleanup is already handled globally after each test via `src/tests/integrations/vitest.setup.tsx`. Therefore, for integration test files under `__tests__/`, do NOT add redundant `afterEach(() => cleanup())`. Only add local `afterEach` teardown for resources that are not covered globally—specifically, when using fake timers, add `afterEach(() => vi.useRealTimers())` (or equivalent) to restore real timers and prevent cross-test interference.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-04-20T20:07:22.981Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11235
File: autogpt_platform/frontend/src/app/(platform)/admin/diagnostics/__tests__/ExecutionsTable.test.tsx:27-76
Timestamp: 2026-04-20T20:07:22.981Z
Learning: In this codebase, Orval-generated API modules under `src/app/api/__generated__/` are not committed to git and must be generated via `pnpm generate:api` (requires a running backend). In integration tests, it’s acceptable—and expected—to stub generated hooks/modules by mocking them with `vi.mock("`@/app/api/__generated__/endpoints/`{tag}/{tag}")`. Do not treat `vi.mock` of these generated hook modules as a violation of the MSW handler guideline, since the corresponding MSW handlers cannot be imported at test time when generated files are absent.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-04T08:04:35.881Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12273
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:216-220
Timestamp: 2026-03-04T08:04:35.881Z
Learning: In the AutoGPT Copilot backend, ensure that SVG images are not treated as vision image types by excluding 'image/svg+xml' from INLINEABLE_MIME_TYPES and MULTIMODAL_TYPES in tool_adapter.py; the Claude API supports PNG, JPEG, GIF, and WebP for vision. SVGs (XML text) should be handled via the text path instead, not the vision path.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-01T04:17:41.600Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12632
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-01T04:17:41.600Z
Learning: When reviewing AutoGPT Copilot tool implementations, accept that `readOnlyHint=True` (provided via `ToolAnnotations`) may be applied unconditionally to *all* tools—even tools that have side effects (e.g., `bash_exec`, `write_workspace_file`, or other write/save operations). Do **not** flag these tools for having `readOnlyHint=True`; this is intentional to enable fully-parallel dispatch by the Anthropic SDK/CLI and has been E2E validated. Only flag `readOnlyHint` issues if they conflict with the established `ToolAnnotations` behavior (e.g., missing/incorrect propagation relative to the intended annotation mechanism).

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-06-06T12:22:37.648Z
Learnt from: anvyle
Repo: Significant-Gravitas/AutoGPT PR: 13302
File: autogpt_platform/backend/backend/copilot/tools/agent_search.py:579-583
Timestamp: 2026-06-06T12:22:37.648Z
Learning: When writing LLM-facing instruction strings that trigger tool calls in this AutoGPT codebase, use the exact registered tool name `view_agent_output` (as defined in `backend/copilot/tools/agent_output.py` via its `name` property and exported via `TOOL_REGISTRY`). Do not reference the bare name `agent_output`, since it is not a valid tool name and will cause tool invocation to fail.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-04T12:19:39.243Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12279
File: autogpt_platform/backend/backend/copilot/tools/base.py:184-188
Timestamp: 2026-03-04T12:19:39.243Z
Learning: In autogpt_platform/backend/backend/copilot/tools/, ensure that anonymous users always pass user_id=None to tool execution methods. The anon_ prefix (e.g., anon_123) is used only for PostHog/analytics distinct_id and must not be used as an actual user_id. Use a simple truthiness check on user_id (e.g., if user_id: ... else: ... or a dedicated is_authenticated flag) to distinguish anonymous from authenticated users, and review all tool execution call sites within this directory to prevent accidentally forwarding an anon_ user_id to tools.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-31T14:22:26.566Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12622
File: autogpt_platform/backend/backend/copilot/tools/agent_search.py:223-236
Timestamp: 2026-03-31T14:22:26.566Z
Learning: In files under autogpt_platform/backend/backend/copilot/tools/, ensure agent graph enrichment uses the typed Pydantic model `backend.data.graph.Graph` for `AgentInfo.graph` (i.e., `Graph | None`), not `dict[str, Any]`. When enriching with graph data (e.g., `_enrich_agents_with_graph`), prefer calling `graph_db().get_graph(graph_id, version=None, user_id=user_id)` directly to retrieve the typed `Graph` object rather than routing through JSON conversions like `get_agent_as_json()` / `graph_to_json()`.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-05T15:42:08.207Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12297
File: .claude/skills/backend-check/SKILL.md:14-16
Timestamp: 2026-03-05T15:42:08.207Z
Learning: In Python files under autogpt_platform/backend (recursively), rely on poetry run format to perform formatting (Black + isort) and linting (ruff). Do not run poetry run lint as a separate step after poetry run format, since format already includes linting checks.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-16T16:35:40.236Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12440
File: autogpt_platform/backend/backend/api/features/workflow_import.py:54-63
Timestamp: 2026-03-16T16:35:40.236Z
Learning: Avoid using the word 'competitor' in public-facing identifiers and text. Use neutral naming for API paths, model names, function names, and UI text. Examples: rename 'CompetitorFormat' to 'SourcePlatform', 'convert_competitor_workflow' to 'convert_workflow', '/competitor-workflow' to '/workflow'. Apply this guideline to files under autogpt_platform/backend and autogpt_platform/frontend.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-03-31T15:37:38.626Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/backend/backend/copilot/tools/agent_generator/fixer.py:37-47
Timestamp: 2026-03-31T15:37:38.626Z
Learning: When validating/constructing Anthropic API model IDs in Significant-Gravitas/AutoGPT, allow the hyphen-separated Claude Opus 4.6 model ID `claude-opus-4-6` (it corresponds to `LlmModel.CLAUDE_4_6_OPUS` in `autogpt_platform/backend/backend/blocks/llm.py`). Do NOT require the dot-separated form in Anthropic contexts. Only OpenRouter routing variants should use the dot separator (e.g., `anthropic/claude-opus-4.6`); `claude-opus-4-6` should be treated as correct when passed to Anthropic, and flagged only if it’s used in the OpenRouter path where the dot form is expected.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-15T02:43:36.890Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12780
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-15T02:43:36.890Z
Learning: When reviewing Python exception handlers, do not flag `isinstance(e, X)` checks as dead/unreachable if the caught exception `X` is a subclass of the exception type being handled. For example, if `X` (e.g., `VirusScanError`) inherits from `ValueError` (directly or via an intermediate class) and it can be raised within an `except ValueError:` block, then `isinstance(e, X)` inside that handler is reachable and should not be treated as dead code.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-05-23T05:29:43.085Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13200
File: autogpt_platform/backend/backend/executor/scheduler.py:590-593
Timestamp: 2026-05-23T05:29:43.085Z
Learning: When reviewing Python code that uses Pydantic discriminated/tagged unions (e.g., `Annotated[Union[...], Field(discriminator="kind")]`), recognize that using `isinstance(x, SomeVariantInfo)` to narrow the union is an intentional and correct runtime guard and should also enable static type narrowing in tools like Pyright. Do not recommend replacing such `isinstance`-based narrowing with `cast(...)` when the check already proves the variant at runtime.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-22T11:46:04.431Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/config.py:0-0
Timestamp: 2026-04-22T11:46:04.431Z
Learning: Do not flag the Claude Sonnet 4.6 model ID as incorrect when it uses the project’s established hyphenated convention: `anthropic/claude-sonnet-4-6`. This hyphen form is the intentional, production convention and should be treated as valid (including in files like llm.py, blocks tests, reasoning.py, `_is_anthropic_model` tests, and config defaults). Note that OpenRouter also accepts the dot variant `anthropic/claude-sonnet-4.6`, so either form may be tolerated, but `anthropic/claude-sonnet-4-6` should be considered the standard to match project usage.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-04-22T11:46:12.892Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/baseline/service.py:322-332
Timestamp: 2026-04-22T11:46:12.892Z
Learning: In this codebase (Significant-Gravitas/AutoGPT), OpenRouter-routed Anthropic model IDs should use the hyphen-separated convention (e.g., `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-6`). Although OpenRouter may accept both hyphen and dot variants, treat the hyphen-separated form as the intended, correct codebase-wide convention and do not flag it as an error. Only flag the dot-separated variant (e.g., `anthropic/claude-sonnet-4.6`) as incorrect when reviewing/validating model ID strings for OpenRouter-routed Anthropic models.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-05-07T18:48:14.242Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13040
File: autogpt_platform/backend/backend/blocks/llm.py:0-0
Timestamp: 2026-05-07T18:48:14.242Z
Learning: In this repository, isort may split imports from the same module into separate blocks when some imports are aliased (e.g., `from module import X as Y`) and others are not. Preserve the two-block layout when it results from isort (such as keeping `from openai.types.chat import ChatCompletion as OpenAIChatCompletion` separate from non-aliased imports from `openai.types.chat`). Do not treat that split as a style issue during review; merging them into a single block can fail CI with `Imports are incorrectly sorted and/or formatted`.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-05-26T14:24:34.866Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13217
File: autogpt_platform/backend/backend/api/features/search/service.py:137-137
Timestamp: 2026-05-26T14:24:34.866Z
Learning: In the Significant-Gravitas/AutoGPT backend, treat `user_id` (an opaque UUID used only for correlation/tracing) as non-PII. Do not flag direct logging of `user_id` in `logger.warning`/`logger.info` statements as a PII exposure issue, as the established convention is to log `user_id` for tracing while reserving PII for fields like email or display name.

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
📚 Learning: 2026-06-11T19:39:10.493Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 13337
File: autogpt_platform/backend/backend/copilot/graphiti/reranker.py:0-0
Timestamp: 2026-06-11T19:39:10.493Z
Learning: In the Significant-Gravitas/AutoGPT Python backend, when calling the OpenAI Python client `chat.completions.create`, construct the `messages` payload using the concrete typed-dict variants from `openai.types.chat` (e.g., `ChatCompletionSystemMessageParam`, `ChatCompletionUserMessageParam`, etc.) rather than trying to instantiate `ChatCompletionMessageParam` directly. `ChatCompletionMessageParam` is a `Union` alias and is not constructible, so `ChatCompletionMessageParam(role=..., content=...)` should fail type checking. Build each message element with the appropriate concrete typed dict and then annotate the resulting list as `list[ChatCompletionMessageParam]` (e.g., `messages: list[ChatCompletionMessageParam] = [ChatCompletionSystemMessageParam(...), ...]`).

Applied to files:

  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
🔇 Additional comments (2)
autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py (1)

20-20: LGTM!

Also applies to: 80-90, 113-127, 129-146, 147-155, 156-174, 175-192, 221-255, 256-277, 278-301, 303-339

autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx (1)

1-44: LGTM!

Also applies to: 45-50, 51-64, 66-87, 88-120, 122-137, 138-150, 151-162, 164-181, 183-202, 203-221, 223-236

…stry

github is never a managed provider, so the sweep-skip test can exercise
the real get_managed_provider lookup instead of forcing it to None.
@Abhi1992002

Copy link
Copy Markdown
Member Author

!deploy

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Deploying PR #13701 to development environment...

@Pwuts

Pwuts commented Jul 29, 2026

Copy link
Copy Markdown
Member

Preview environment is live (all services healthy)

  • Deployed: 162a854bee06d2b2a39fc4190af699c915be0b59 at 2026-07-29 11:43 UTC
  • Database: isolated Supabase branch pr-13701 (state persists across redeploys unless migration drift forces a reset)
  • URLs: posted in the team Discord

Push more commits, then comment !deploy to update · !undeploy or close the PR to tear down.

@Abhi1992002

Copy link
Copy Markdown
Member Author

!undeploy

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🗑️ Undeploying PR #13701 from development environment...

@Pwuts

Pwuts commented Aug 1, 2026

Copy link
Copy Markdown
Member

🧹 Preview Environment Cleaned Up

All resources for PR #13701 have been removed:

  • ☸️ Kubernetes namespace deleted
  • 🗃️ Preview branch database deleted

Cleanup completed successfully.

Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py Outdated
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py Outdated
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py Outdated
Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py
Comment thread autogpt_platform/backend/backend/copilot/tools/__init__.py
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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

🧹 Nitpick comments (3)
autogpt_platform/backend/backend/blocks/autopilot.py (1)

175-176: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

State that deny-list mode always blocks the credential inventory.

The current wording explains allow-list mode only. In deny-list mode the builder appends list_user_credentials to the deny list unconditionally, so the default configuration (tools=[], tools_exclude=True) blocks the tool with no way to re-enable it. Say this explicitly so users are not surprised.

✏️ Proposed wording
                 "Leave empty to apply no tool filter. Credential inventory "
-                "is sensitive and must be explicitly included in allow-list mode."
+                "(`list_user_credentials`) is sensitive: it is always blocked in "
+                "deny-list mode, and is only available when you name it "
+                "explicitly in allow-list mode (tools_exclude=false)."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/blocks/autopilot.py` around lines 175 - 176,
Update the tool-filter description near the allow-list wording to explicitly
state that deny-list mode always blocks the credential inventory, including the
default configuration, and that it cannot be re-enabled through the filter.
autogpt_platform/backend/backend/copilot/tools/list_credentials.py (2)

106-110: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Normalize the provider filter once.

_execute computes wanted_provider at Line 106. _serialize_connected_credentials recomputes the same value at Line 141 and returns it. Two normalization sites can diverge if the trim/lowercase rule changes. Pass the already-normalized value instead.

♻️ Proposed consolidation
-        metas, wanted = _serialize_connected_credentials(all_creds, provider)
+        metas = _serialize_connected_credentials(all_creds, wanted_provider)
         providers = sorted({m.provider for m in metas})
 
         return CredentialListResponse(
             message=_build_inventory_message(
-                metas, providers, wanted, provisioning_complete
+                metas, providers, wanted_provider, provisioning_complete
             ),
 def _serialize_connected_credentials(
-    all_creds: list[Any], provider: str | None
-) -> tuple[list[CredentialsMetaResponse], str]:
+    all_creds: list[Any], wanted: str
+) -> list[CredentialsMetaResponse]:
     """Strip secrets and drop non-user credentials, then apply the provider filter."""
-    wanted = provider.strip().lower() if provider else ""
-
@@
-    return metas, wanted
+    return metas

Also applies to: 137-155

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/copilot/tools/list_credentials.py` around
lines 106 - 110, Update the credential execution flow to pass the
already-normalized wanted_provider from _execute into
_serialize_connected_credentials. Remove the duplicate provider.strip().lower()
normalization in _serialize_connected_credentials and use its parameter when
filtering or returning the provider value, keeping the existing behavior for an
absent provider.

137-167: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace Any with the concrete credentials type.

_serialize_connected_credentials and _to_safe_meta_response accept Any, so cred.id, cred.provider, and the to_meta_response contract are unchecked. The backend exposes a concrete credentials union in backend.data.model. Use it so a field rename in the credential models fails type checking here instead of at runtime.

As per coding guidelines, "Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead."

♻️ Proposed typing change
-def _serialize_connected_credentials(
-    all_creds: list[Any], provider: str | None
-) -> tuple[list[CredentialsMetaResponse], str]:
+def _serialize_connected_credentials(
+    all_creds: list[Credentials], provider: str | None
+) -> tuple[list[CredentialsMetaResponse], str]:
-def _to_safe_meta_response(cred: Any) -> CredentialsMetaResponse:
+def _to_safe_meta_response(cred: Credentials) -> CredentialsMetaResponse:

Import the union alongside the existing model import:

-from backend.data.model import is_sdk_default
+from backend.data.model import Credentials, is_sdk_default
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/copilot/tools/list_credentials.py` around
lines 137 - 167, Replace Any in _serialize_connected_credentials and
_to_safe_meta_response with the concrete credentials union exported by
backend.data.model. Import that union and use it for all_creds and cred so id,
provider, and to_meta_response are statically checked. Preserve the existing
filtering and safe metadata serialization behavior without adding runtime type
dispatch.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py`:
- Around line 247-249: Remove the explicit return None from the get_provider
side-effect callable, leaving the assertion and implicit None return intact so
the not-managed-provider behavior is preserved and Ruff RET501/PLR1711 pass.

---

Nitpick comments:
In `@autogpt_platform/backend/backend/blocks/autopilot.py`:
- Around line 175-176: Update the tool-filter description near the allow-list
wording to explicitly state that deny-list mode always blocks the credential
inventory, including the default configuration, and that it cannot be re-enabled
through the filter.

In `@autogpt_platform/backend/backend/copilot/tools/list_credentials.py`:
- Around line 106-110: Update the credential execution flow to pass the
already-normalized wanted_provider from _execute into
_serialize_connected_credentials. Remove the duplicate provider.strip().lower()
normalization in _serialize_connected_credentials and use its parameter when
filtering or returning the provider value, keeping the existing behavior for an
absent provider.
- Around line 137-167: Replace Any in _serialize_connected_credentials and
_to_safe_meta_response with the concrete credentials union exported by
backend.data.model. Import that union and use it for all_creds and cred so id,
provider, and to_meta_response are statically checked. Preserve the existing
filtering and safe metadata serialization behavior without adding runtime type
dispatch.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af5d2abc-1316-44e8-baa1-1fd2dd206f9d

📥 Commits

Reviewing files that changed from the base of the PR and between f6b98c5 and cd12193.

📒 Files selected for processing (18)
  • autogpt_platform/backend/backend/api/features/integrations/router_test.py
  • autogpt_platform/backend/backend/blocks/autopilot.py
  • autogpt_platform/backend/backend/blocks/autopilot_permissions_test.py
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/backend/backend/copilot/prompting.py
  • autogpt_platform/backend/backend/copilot/prompting_test.py
  • autogpt_platform/backend/backend/copilot/tools/__init__.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials.py
  • autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
  • autogpt_platform/backend/backend/integrations/managed_credentials.py
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/__tests__/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
  • autogpt_platform/frontend/src/app/api/openapi.json
🚧 Files skipped from review as they are similar to previous changes (9)
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/components/MessagePartRenderer.tsx
  • autogpt_platform/backend/backend/copilot/tools/init.py
  • autogpt_platform/backend/backend/copilot/tools/models.py
  • autogpt_platform/frontend/src/app/api/openapi.json
  • autogpt_platform/backend/backend/copilot/permissions.py
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/tests/ListCredentialsTool.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/ListCredentialsTool.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/tools/ListCredentialsTool/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/helpers.ts

Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials_test.py Outdated
@github-actions github-actions Bot added documentation Improvements or additions to documentation cla: pending CLA not yet signed by all contributors labels Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Friendly reminder: This PR is waiting on a signed CLA.

All contributors need to sign our Contributor License Agreement before we can merge this PR.

➡️ Sign the CLA here

Why do we need a CLA?

The CLA protects both you and the project by clarifying the terms under which your contribution is made. It's a one-time process — once signed, it covers all your future contributions.

Common issues
  • Email mismatch: Make sure your Git commit email matches your GitHub account email
  • Stale branch: Sync your branch with the current dev branch and push the updated branch normally
  • Multiple authors: All commit authors need to sign, not just the PR author

If you have questions, just ask! 🙂

@github-actions github-actions Bot added cla: signed CLA signed by all contributors and removed cla: signed CLA signed by all contributors cla: pending CLA not yet signed by all contributors labels Aug 12, 2026
@ntindle

ntindle commented Aug 12, 2026

Copy link
Copy Markdown
Member

🤖 Addressed the fresh top-level review in 2c25f0f11: normalized the provider filter once, typed credential serialization with the concrete Credentials union, clarified that AutoPilot always blocks credential inventory in deny-list/default mode, and regenerated the synced block documentation. Full backend format/Pyright, 284 focused tests, docs-sync, and full frontend format/lint/types are green.

Comment thread autogpt_platform/backend/backend/copilot/tools/list_credentials.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed CLA signed by all contributors documentation Improvements or additions to documentation platform/backend AutoGPT Platform - Back end platform/blocks platform/frontend AutoGPT Platform - Front end size/xl

Projects

Status: 🆕 Needs initial review
Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants