Skip to content

feat(mcp): add show_connection_sync_history interactive UI tool#1042

Merged
Aaron ("AJ") Steers (aaronsteers) merged 31 commits into
mainfrom
devin/1780453086-show-sync-history
Jun 3, 2026
Merged

feat(mcp): add show_connection_sync_history interactive UI tool#1042
Aaron ("AJ") Steers (aaronsteers) merged 31 commits into
mainfrom
devin/1780453086-show-sync-history

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Adds show_sync_history — a new interactive MCP tool that renders a Prefab dashboard for an Airbyte Cloud connection's sync history. Built for the Snowflake Summit demo.

The tool fetches connection.get_previous_sync_logs() and renders:

  • Header: Connection name (hyperlinked to job timeline) with (Source → Destination) subtitle
  • Metric cards: Total Syncs, Success Rate (with trend), Records Synced, Bytes Synced
  • Tabbed charts: Per-job continuous timeline — BarChart (success/fail), LineChart (records), LineChart (bytes)
  • Collapsible DataTable: Job history with status, records, bytes, start time (collapsed by default via Accordion)

Key design decisions:

  • agent_context: Literal["min", "summary", "verbose"] (default "min") — three-tier control over how much text context the agent receives. All tiers open with "The user has already been shown..." to suppress re-summarization.
  • suppress_ui: bool = False — when True, skips Prefab rendering and returns text-only. Enables follow-up "give me the data" calls without re-rendering the dashboard.
  • Dynamic followup hints: min suggests summary/verbose, summary suggests verbose, verbose has no hint.
  • Gated by INTERACTIVE_UI_ANNOTATION — only visible to MCP Apps-capable clients.

Requested by Aaron ("AJ") Steers (@aaronsteers) for the Snowflake Summit demo.

Link to Devin session: https://app.devin.ai/sessions/33fa308d9fd44d80b1323e85cf60ef6c

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced an interactive Sync History dashboard for monitoring Airbyte Cloud connections. The dashboard displays job status, synced records and bytes, success rates, and success rate trends, along with visual charts and detailed job history for comprehensive performance insights.

devin-ai-integration Bot and others added 18 commits May 31, 2026 02:48
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Adds a new Prefab UI tool that renders a sync history dashboard for
an Airbyte Cloud connection. Includes:
- Metric cards (total syncs, success rate, records/bytes synced)
- Stacked bar chart of success/failure by date
- Line charts of records and bytes over time
- Detailed job history data table

The tool uses the existing Cloud API (get_previous_sync_logs) and
renders via the Prefab UI framework for MCP Apps-capable clients.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1780453086-show-sync-history' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1780453086-show-sync-history'

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

Fixes pyrefly type errors:
- Tab uses 'title' not 'label' keyword
- chart_data typed as list[dict[str, int | str]] to match actual data

Co-Authored-By: AJ Steers <aj@airbyte.io>
@github-code-quality

github-code-quality Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-fast

The overall coverage in the branch is 66%. The coverage in the branch is 65%.

Show a code coverage summary of the most impacted files.
File d9f652f 0762a75 +/-
airbyte/exceptions.py 84% 84% 0%
airbyte/registry.py 70% 72% +2%
airbyte/mcp/server.py 69% 71% +2%
airbyte/mcp/_tool_utils.py 72% 77% +5%
airbyte/mcp/int...c_history_ui.py 0% 27% +27%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/int...ive/__init__.py 0% 100% +100%
airbyte/mcp/int...tive/_prefab.py 0% 100% +100%

Python / code-coverage/pytest-no-creds

The overall coverage in the branch is 66%. The coverage in the branch is 65%.

Show a code coverage summary of the most impacted files.
File d9f652f 0762a75 +/-
airbyte/exceptions.py 84% 84% 0%
airbyte/registry.py 70% 72% +2%
airbyte/mcp/server.py 69% 71% +2%
airbyte/mcp/_tool_utils.py 72% 77% +5%
airbyte/mcp/int...c_history_ui.py 0% 27% +27%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/int...ive/__init__.py 0% 100% +100%
airbyte/mcp/int...tive/_prefab.py 0% 100% +100%

Python / code-coverage/pytest

The overall coverage in the branch remains at 71%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File d9f652f 0762a75 +/-
airbyte/registry.py 70% 72% +2%
airbyte/mcp/server.py 69% 71% +2%
airbyte/mcp/_tool_utils.py 72% 77% +5%
airbyte/mcp/int...c_history_ui.py 0% 27% +27%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/int...ive/__init__.py 0% 100% +100%
airbyte/mcp/int...tive/_prefab.py 0% 100% +100%

Updated June 03, 2026 15:58 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review June 3, 2026 02:51

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread airbyte/mcp/interactive/_sync_history_ui.py Outdated
Comment thread airbyte/mcp/interactive/_sync_history_ui.py Outdated
devin-ai-integration Bot and others added 4 commits June 3, 2026 02:56
- Fix DataTable parameter: data= -> rows= (fixes empty table rendering)
- Add model_preview_count/limit/truncated/omitted_count/render_note
  to agent_summary following the pattern in _registry_ui.py

Co-Authored-By: AJ Steers <aj@airbyte.io>
…arts

Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Three-tier control for agent text response verbosity:
- verbose: full job-level data for detailed follow-up analysis
- default: aggregates and key observations only
- min: one-liner confirmation that the dashboard rendered

All tiers explicitly state the user has already been shown the
dashboard, suppressing re-summarization by the agent.

Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
devin-ai-integration Bot and others added 3 commits June 3, 2026 03:40
…_ui param

Co-Authored-By: AJ Steers <aj@airbyte.io>
- Dashboard heading shows connection name
- Subtitle links connection name to job timeline URL
- Source and destination names linked to their actor URLs
- Job History table wrapped in collapsible Accordion (collapsed by default)
- _build_agent_text now includes connection_name in context

Co-Authored-By: AJ Steers <aj@airbyte.io>
Base automatically changed from devin/1780194277-coral-mcp-connector-catalog-ui to main June 3, 2026 15:26
Co-Authored-By: AJ Steers <aj@airbyte.io>
Comment thread airbyte/mcp/interactive/_sync_history_ui.py Outdated
Copilot AI review requested due to automatic review settings June 3, 2026 15:31
@aaronsteers Aaron ("AJ") Steers (aaronsteers) removed the request for review from Copilot June 3, 2026 15:31
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds show_connection_sync_history, an MCP tool that fetches recent connection sync logs, computes per-job metrics and aggregates, builds chart datasets, and returns either agent-only text or a Prefab UI app with metrics, charts, and a job history table. wdyt?

Changes

Sync History Dashboard Tool

Layer / File(s) Summary
Module export setup
airbyte/mcp/interactive/__init__.py
Imports and exposes show_connection_sync_history in the module __all__ to make the tool public.
Formatting helpers and constants
airbyte/mcp/interactive/_sync_history_ui.py (lines 39–73)
Defines byte/record formatting thresholds, success-rate sentiment bands, and helper functions for human-readable bytes/records and chart time labels.
Core tool implementation and data aggregation
airbyte/mcp/interactive/_sync_history_ui.py (lines 75–220)
Implements show_connection_sync_history: resolves workspace/connection, fetches up to max_jobs sync logs, computes per-job status/metrics and aggregates (success rate, totals), and prepares chronological chart data; conditionally returns text-only or structured UI.
Agent text and Prefab UI construction
airbyte/mcp/interactive/_sync_history_ui.py (lines 222–412)
Adds _build_agent_text (min/summary/verbose modes) and _build_sync_history_app that builds the Prefab UI: navigation links, metric cards (including success-rate trend/delta), three chart tabs, and an accordion-wrapped job history table with formatted values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • airbytehq/PyAirbyte#1040: Related changes that also extend airbyte/mcp/interactive/__init__.py to export UI-oriented show_ tools.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a new interactive UI tool called show_connection_sync_history to the MCP module.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1780453086-show-sync-history

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 and usage tips.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
airbyte/mcp/interactive/_sync_history_ui.py (1)

169-181: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix success-rate/chart bucketing for non-final job statuses

show_connection_sync_history() (airbyte/mcp/interactive/_sync_history_ui.py lines ~169-181) treats anything that doesn’t include "succeeded" as "failed". If get_previous_sync_logs() can return non-terminal statuses like "running"/"pending" (per the SyncJobResult.status docs), would you want to exclude non-final jobs from the success-rate + “failed” series, or bucket them separately (while still treating "cancelled" as failed if that’s intended)? wdyt?

🤖 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 `@airbyte/mcp/interactive/_sync_history_ui.py` around lines 169 - 181, The
current logic in show_connection_sync_history() treats any status not containing
"succeeded" as failed; update the success-rate and chart bucketing to only
consider terminal statuses: compute succeeded as statuses equal to "succeeded"
and compute total_terminal_jobs (used for success_rate) as count of statuses in
the terminal set; treat statuses in {"failed", "cancelled"} as failed; treat
non-terminal statuses from get_previous_sync_logs() (e.g., "running", "pending"
per SyncJobResult.status) as a separate bucket (e.g., "in_progress") in
chart_data rather than counting them as failed; update the succeeded
calculation, success_rate denominator (use total_terminal_jobs), and the per-job
chart_data entries (succeeded/failed/in_progress) accordingly so charts and
rates exclude non-final jobs.
🤖 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.

Outside diff comments:
In `@airbyte/mcp/interactive/_sync_history_ui.py`:
- Around line 169-181: The current logic in show_connection_sync_history()
treats any status not containing "succeeded" as failed; update the success-rate
and chart bucketing to only consider terminal statuses: compute succeeded as
statuses equal to "succeeded" and compute total_terminal_jobs (used for
success_rate) as count of statuses in the terminal set; treat statuses in
{"failed", "cancelled"} as failed; treat non-terminal statuses from
get_previous_sync_logs() (e.g., "running", "pending" per SyncJobResult.status)
as a separate bucket (e.g., "in_progress") in chart_data rather than counting
them as failed; update the succeeded calculation, success_rate denominator (use
total_terminal_jobs), and the per-job chart_data entries
(succeeded/failed/in_progress) accordingly so charts and rates exclude non-final
jobs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c000c20-1c80-49a7-94e8-a232bf3d654c

📥 Commits

Reviewing files that changed from the base of the PR and between fcad41b and 0762a75.

📒 Files selected for processing (2)
  • airbyte/mcp/interactive/__init__.py
  • airbyte/mcp/interactive/_sync_history_ui.py

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Re: non-terminal job status bucketing (lines 169-181)

Valid observation. get_previous_sync_logs() returns jobs ordered by creation time without filtering by terminal status, so a currently-running job could appear in the results and would be counted as "failed" under the current logic.

Assessment: Low-risk for the demo use case — historical sync logs are overwhelmingly terminal. The API returns completed jobs in practice because syncs finish quickly relative to polling frequency. However, I agree it's worth hardening: excluding non-terminal jobs from the success rate denominator and charting them separately (or omitting them) would be more correct.

Deferring to Aaron ("AJ") Steers (@aaronsteers) on whether to address now or in a follow-up.


Devin session

@devin-ai-integration devin-ai-integration Bot changed the title feat(mcp): add show_sync_history interactive UI tool feat(mcp): add show_connection_sync_history interactive UI tool Jun 3, 2026
@aaronsteers Aaron ("AJ") Steers (aaronsteers) changed the title feat(mcp): add show_connection_sync_history interactive UI tool feat(mcp): add show_connection_sync_history interactive UI tool Jun 3, 2026
@aaronsteers Aaron ("AJ") Steers (aaronsteers) merged commit da03d99 into main Jun 3, 2026
23 checks passed
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the devin/1780453086-show-sync-history branch June 3, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant