Skip to content

Revert "improvement(mship): clean up dead tools, add enrichments"#5057

Merged
Sg312 merged 1 commit into
stagingfrom
revert-5056-dev
Jun 15, 2026
Merged

Revert "improvement(mship): clean up dead tools, add enrichments"#5057
Sg312 merged 1 commit into
stagingfrom
revert-5056-dev

Conversation

@Sg312

@Sg312 Sg312 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Reverts #5056

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 15, 2026 5:43pm

Request Review

@Sg312 Sg312 merged commit 1750043 into staging Jun 15, 2026
4 checks passed
@greptile-apps

greptile-apps Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reverts #5056 ("clean up dead tools, add enrichments"), swapping enrichment_run back out and restoring touch_plan as a feature-flagged copilot tool. On top of the revert it folds in a few small improvements: better error guidance in create-file.ts and resource-writer.ts, richer VFS path examples in tool descriptions across ffmpeg/function_execute/media tools, and a cosmetic key-style cleanup in tool-schemas-v1.ts.

  • touch_plan restored: Creates workspace- or workflow-scoped plan files via VFS alias resolution, gated behind isMothershipBetaFeaturesEnabled at both the registry and tool level.
  • enrichment_run removed: Server tool, catalog entry, and runtime schema all deleted cleanly.
  • Error messages improved: create_file and resource-writer now point users to touch_plan when a plan alias is missing.

Confidence Score: 4/5

Safe to merge — the swap of enrichment_run for touch_plan is self-contained and the new tool carries its own access checks.

The title parameter is declared in both the interface and the catalog description but never read inside execute, so any title passed by the model is silently discarded. The in-tool feature-flag guard duplicates the registry-level gate in router.ts, creating redundant maintenance surface. Neither issue affects correctness at runtime.

apps/sim/lib/copilot/tools/server/files/touch-plan.ts — the unused title field and the redundant flag check both live here.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/tools/server/files/touch-plan.ts New touch_plan server tool — creates workspace/workflow plan files via alias resolution; title param declared but never used, and the internal feature-flag guard is redundant with the router-level gate.
apps/sim/lib/copilot/tools/server/router.ts Removes enrichmentRunServerTool, registers touchPlanServerTool, and adds conditional registry gating on isMothershipBetaFeaturesEnabled; the gating logic is correct but duplicates the in-tool flag check.
apps/sim/lib/copilot/generated/tool-catalog-v1.ts Removes EnrichmentRun catalog entry, adds TouchPlan with correct permissions/capabilities, and enriches VFS path descriptions across several tools.
apps/sim/lib/copilot/generated/tool-schemas-v1.ts Removes enrichment_run runtime schema, adds touch_plan runtime schema, and converts all computed string-literal keys (e.g. ['agent']) to plain identifiers — cosmetic but correct.
apps/sim/lib/copilot/tools/server/enrichment/enrichment-run.ts File deleted as part of the revert; enrichment_run tool and its implementation are removed cleanly.
apps/sim/lib/copilot/tools/server/files/touch-plan.test.ts New test file with three focused scenarios: workflow plan creation, workspace plan creation, and missing-workflow rejection guard; coverage is adequate for the happy paths.
apps/sim/lib/copilot/tools/server/files/create-file.ts One-line improvement to the error message for plan-alias creation, directing users to touch_plan.
apps/sim/lib/copilot/vfs/resource-writer.ts Error message for missing plan backing directory updated to suggest touch_plan; no logic changes.

Sequence Diagram

sequenceDiagram
    participant AI as Copilot AI
    participant Router as router.ts (getServerToolRegistry)
    participant Tool as touchPlanServerTool
    participant Resolver as resolveWorkflowAliasForWorkspace
    participant Writer as writeWorkspaceFileByPath

    AI->>Router: routeExecution("touch_plan", params)
    alt "isMothershipBetaFeaturesEnabled = false"
        Router-->>AI: tool not in registry → Error
    else "flag = true"
        Router->>Tool: execute(params, context)
        Tool->>Tool: normalizeWorkflowPath / normalizePlanRelativePath
        Tool->>Resolver: "resolveWorkflowAliasForWorkspace({ workspaceId, path: aliasPath })"
        alt "alias not found / kind != plan_file"
            Resolver-->>Tool: null
            Tool-->>AI: "{ success: false, message: "Workflow not found …" }"
        else alias resolved
            Resolver-->>Tool: alias (kind: plan_file, scope, workflowId, …)
            Tool->>Writer: "writeWorkspaceFileByPath({ mode: "create", … })"
            Writer-->>Tool: "{ id, name, vfsPath, backingVfsPath }"
            Tool-->>AI: "{ success: true, data: { id, vfsPath, scope, workflowId } }"
        end
    end
Loading

Reviews (1): Last reviewed commit: "Revert "improvement(mship): clean up dea..." | Re-trigger Greptile

scope?: 'workspace' | 'workflow'
workflowPath?: string
name: string
title?: string

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.

P2 title parameter declared but never consumed

TouchPlanArgs includes title?: string and the catalog describes it as "Optional short user-visible label for the plan creation", but nothing in execute reads or forwards title. Any value passed by the AI model is silently dropped, which means the described capability is advertised but not delivered.

import { isMothershipBetaFeaturesEnabled } from '@/lib/core/config/feature-flags'

const logger = createLogger('TouchPlanServerTool')
const TOUCH_PLAN_TOOL_ID = 'touch_plan'

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.

P2 TOUCH_PLAN_TOOL_ID constant duplicates the catalog ID

The tool declares its own string constant instead of importing TouchPlan.id from the catalog — unlike enrichment-run.ts, which used EnrichmentRun.id directly. If the catalog entry's id field is ever renamed, this constant and the catalog can silently diverge and break tool routing.

Suggested change
const TOUCH_PLAN_TOOL_ID = 'touch_plan'
import { TouchPlan } from '@/lib/copilot/generated/tool-catalog-v1'

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +68 to +70
if (!isMothershipBetaFeaturesEnabled) {
return { success: false, message: 'touch_plan is not available' }
}

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.

P2 Redundant in-tool feature flag check

getServerToolRegistry() in router.ts already deletes touchPlanServerTool from the registry when isMothershipBetaFeaturesEnabled is false, so this guard inside execute can never be reached through normal dispatch. The double-gate isn't harmful, but it adds maintenance surface — future readers may update one gate and miss the other.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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