Skip to content

Add GitHub Actions workflow for MCP agent session backfill - #1052

Merged
kentcdodds merged 1 commit into
mainfrom
ops/mcp-agent-session-backfill-workflow
Jul 30, 2026
Merged

kentcdodds merged 1 commit into
mainfrom
ops/mcp-agent-session-backfill-workflow

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Trigger dry-run via gh workflow run backfill-mcp-agent-sessions.yml -f mode=dry-run
  • Review uploaded audit artifact (no no_owner / ownership conflicts / failures)
  • Re-run with -f mode=execute
  • Confirm account deletion is no longer blocked by the backfill marker

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added a manually triggered workflow for backfilling MCP agent sessions.
    • Supports dry-run and execute modes, configurable deployment settings, audit summaries, and downloadable audit reports.
  • Documentation

    • Added instructions for using the preferred workflow.
    • Updated local dry-run and execution guidance, including required environment settings and review steps.

Lets operators dry-run and execute the production sweep with existing CF secrets, and documents the correct kody-production worker script.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kentcdodds
kentcdodds merged commit 06aa3d7 into main Jul 30, 2026
6 of 9 checks passed
@kentcdodds
kentcdodds deleted the ops/mcp-agent-session-backfill-workflow branch July 30, 2026 12:36
@kentcdodds

Copy link
Copy Markdown
Owner Author

Merged and dry-run triggered on main. Cleanup tracked in #1051.

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5485103. Configure here.


echo "Running backfill mode=${BACKFILL_MODE} origin=${BACKFILL_ORIGIN} worker_script=${BACKFILL_WORKER_SCRIPT}"
npm run backfill:mcp-agent-sessions -- "${args[@]}"
echo "AUDIT_PATH=${RUNNER_TEMP}/mcp-agent-session-backfill-${BACKFILL_MODE}.json" >> "$GITHUB_ENV"

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.

Audit artifact skipped on failure

Medium Severity

AUDIT_PATH is written to GITHUB_ENV only after npm run backfill:mcp-agent-sessions succeeds. In execute mode, runMcpAgentSessionBackfill writes the audit file then exits with an error when failures remain, so later steps gated on env.AUDIT_PATH skip summarize and upload even though the audit JSON exists on the runner.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5485103. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 18352769-c7e8-40df-aa86-a18bee3245be

📥 Commits

Reviewing files that changed from the base of the PR and between f0d0b2b and 5485103.

📒 Files selected for processing (2)
  • .github/workflows/backfill-mcp-agent-sessions.yml
  • docs/contributing/mcp-agent-session-backfill.md

📝 Walkthrough

Walkthrough

Adds a manually triggered GitHub Actions workflow for MCP agent session backfills, including dry-run/execute modes, audit summarization, and artifact upload. Updates contributor documentation with workflow usage, environment requirements, and kody-production CLI commands.

Changes

MCP agent session backfill

Layer / File(s) Summary
Backfill workflow and audit handling
.github/workflows/backfill-mcp-agent-sessions.yml
Adds manual inputs, concurrency control, dependency setup, credential validation, conditional execution, audit JSON summarization, and 30-day artifact upload.
Backfill operating instructions
docs/contributing/mcp-agent-session-backfill.md
Documents the preferred dry-run workflow, audit review process, required local environment, and updated local commands using kody-production.

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

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant GitHubActions
  participant BackfillCLI
  participant Worker
  participant AuditArtifact
  Operator->>GitHubActions: Dispatch mode, origin, and worker script
  GitHubActions->>BackfillCLI: Run backfill command with credentials and arguments
  BackfillCLI->>Worker: Paginate objects and call ownership RPC
  Worker-->>BackfillCLI: Return session ownership data
  BackfillCLI-->>GitHubActions: Write audit JSON
  GitHubActions->>AuditArtifact: Summarize and upload audit JSON
Loading
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ops/mcp-agent-session-backfill-workflow

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.

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