-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: add run status for cli and mcp #1022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,8 @@ interface RunAttributes { | |
| runByScheduleId?: string; | ||
| runByAPI?: boolean; | ||
| runBySDK?: boolean; | ||
| runByMCP?: boolean; | ||
| runByCLI?: boolean; | ||
| serializableOutput: Record<string, any>; | ||
| binaryOutput: Record<string, string>; | ||
| retryCount?: number; | ||
|
|
@@ -47,6 +49,8 @@ class Run extends Model<RunAttributes, RunCreationAttributes> implements RunAttr | |
| public runByScheduleId!: string; | ||
| public runByAPI!: boolean; | ||
| public runBySDK!: boolean; | ||
| public runByMCP!: boolean; | ||
| public runByCLI!: boolean; | ||
| public serializableOutput!: Record<string, any>; | ||
| public binaryOutput!: Record<string, any>; | ||
| public retryCount!: number; | ||
|
|
@@ -119,6 +123,14 @@ Run.init( | |
| type: DataTypes.BOOLEAN, | ||
| allowNull: true, | ||
| }, | ||
| runByMCP: { | ||
| type: DataTypes.BOOLEAN, | ||
| allowNull: true, | ||
| }, | ||
| runByCLI: { | ||
| type: DataTypes.BOOLEAN, | ||
| allowNull: true, | ||
| }, | ||
|
Comment on lines
+126
to
+133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for migration files that might add runByMCP or runByCLI columns
fd -e js -e ts migration | xargs -I{} grep -l -E 'runByMCP|runByCLI' {} 2>/dev/null || echo "No migration found"
# Also check for any migration files in common locations
fd -t f -e js -e ts . -p 'migrations|migrate' 2>/dev/null | head -20Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # First, let's check the actual Run.ts file at the specified lines
head -140 server/src/models/Run.ts | tail -20Repository: getmaxun/maxun Length of output: 452 🏁 Script executed: # Check if migrations directory exists and what's in it
find . -type d -name migrations -o -type d -name migrate 2>/dev/null | head -10Repository: getmaxun/maxun Length of output: 84 🏁 Script executed: # Look for any SQL migration files
find . -type f -name "*.sql" 2>/dev/null | head -20Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Check for Sequelize configuration and migration patterns
find . -type f \( -name ".sequelizerc" -o -name "sequelize.config.*" -o -name "config.json" \) 2>/dev/nullRepository: getmaxun/maxun Length of output: 100 🏁 Script executed: # List all TypeScript/JS files in common migration paths
fd -t f -e js -e ts -e sql . -p '(migration|migrate|db/|database/)' 2>/dev/null | head -30Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Check what's in the migrations directory
ls -la server/src/db/migrations/Repository: getmaxun/maxun Length of output: 432 🏁 Script executed: # Count and list migration files
find server/src/db/migrations -type f | sortRepository: getmaxun/maxun Length of output: 248 🏁 Script executed: # Check .sequelizerc content to understand migration setup
cat .sequelizercRepository: getmaxun/maxun Length of output: 349 🏁 Script executed: # Check the config.json to see Sequelize setup
cat server/config/config.jsonRepository: getmaxun/maxun Length of output: 634 🏁 Script executed: # Search the entire migrations directory for any reference to runByMCP or runByCLI
rg -i 'runByMCP|runByCLI' server/src/db/migrations/Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # List all files in migrations directory with more details
find server/src/db/migrations -type f -exec basename {} \; | sortRepository: getmaxun/maxun Length of output: 173 🏁 Script executed: # Check the most recent migration file
cat server/src/db/migrations/20250612000000-add-robot-name-unique-index.jsRepository: getmaxun/maxun Length of output: 469 🏁 Script executed: # Check the first migration which appears to add columns
cat server/src/db/migrations/20250327111003-add-airtable-columns.jsRepository: getmaxun/maxun Length of output: 3263 🏁 Script executed: # Check the Run.ts model to see all attributes and when they might have been added
grep -n "runBy\|type: DataTypes.BOOLEAN" server/src/models/Run.ts | head -30Repository: getmaxun/maxun Length of output: 685 🏁 Script executed: # Check the webhooks migration
cat server/src/db/migrations/20250527105655-add-webhooks.jsRepository: getmaxun/maxun Length of output: 853 🏁 Script executed: # Verify which table the Run model uses
grep -n "tableName\|table:" server/src/models/Run.ts | head -5Repository: getmaxun/maxun Length of output: 83 🏁 Script executed: # Search across all migrations for any reference to 'run' table
rg -i "addColumn.*'run'|addColumn.*\"run\"" server/src/db/migrations/Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Check git status to see what files are in this PR
git status --shortRepository: getmaxun/maxun Length of output: 71 🏁 Script executed: # Check if there are any uncommitted migration files
git diff --name-onlyRepository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Look for any migration files that might be timestamped with recent dates (April 2026)
ls -lt server/src/db/migrations/ | head -10Repository: getmaxun/maxun Length of output: 329 🏁 Script executed: # Get the full Run.ts file to understand the context better
wc -l server/src/models/Run.tsRepository: getmaxun/maxun Length of output: 86 🏁 Script executed: # Check if runBySDK was already in the model previously or if it's new
git log -1 --name-only server/src/models/Run.ts 2>/dev/null || echo "Not in git history"Repository: getmaxun/maxun Length of output: 257 🏁 Script executed: # Check recent commits to the Run model
git log --oneline -n 10 -- server/src/models/Run.ts 2>/dev/null || echo "Unable to get git log"Repository: getmaxun/maxun Length of output: 99 🏁 Script executed: # Let's check if there's a pending migration file that hasn't been added yet
find . -name "*runBy*" -o -name "*run-*.js" -o -name "*run-*.ts" 2>/dev/null | grep -i migratRepository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Get the complete Run.ts model around the new columns
sed -n '110,140p' server/src/models/Run.tsRepository: getmaxun/maxun Length of output: 683 🏁 Script executed: # Check if runBySDK exists in migrations (if it does, it shows a pattern)
rg -i 'runBySDK' server/src/db/migrations/Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Verify the table name one more time and check git diff for this file
git diff HEAD -- server/src/models/Run.ts | head -100Repository: getmaxun/maxun Length of output: 40 🏁 Script executed: # Check what's actually staged for commit
git status -sRepository: getmaxun/maxun Length of output: 71 🏁 Script executed: # Check the current HEAD to see what's committed vs what's being reviewed
git show --stat HEAD | head -30Repository: getmaxun/maxun Length of output: 1698 🏁 Script executed: # Final verification: list all migration files with timestamps to see if any cover runBy* columns
ls -la server/src/db/migrations/ && echo "---" && grep -r "runByMCP\|runByCLI" server/src/db/migrations/ || echo "No runBy* columns in migrations"Repository: getmaxun/maxun Length of output: 468 Missing database migration for new columns. The model defines Add a migration to alter the ALTER TABLE run ADD COLUMN "runByMCP" BOOLEAN;
ALTER TABLE run ADD COLUMN "runByCLI" BOOLEAN;🤖 Prompt for AI Agents |
||
| serializableOutput: { | ||
| type: DataTypes.JSONB, | ||
| allowNull: true, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle
mcpexplicitly when derivingrunSource.Line 492 currently maps only
'cli'; every other value (including'mcp') is forced to'sdk'. That causes MCP runs (sent withx-run-source: mcpfromserver/src/mcp-worker.ts, Line 41) to be persisted as SDK, sorunByMCPnever gets set inserver/src/api/record.ts.💡 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents