Skip to content

Flag automation runs that repeat the same report or act without changing anything #3442

Closed

Description

@integry

Problem

A scheduled automation can complete every night with an empty or unchanged report, or an acting step that did nothing, and still show as completed. Nothing detects it.

Goal

Mark unproductive runs and tell the owner after several in a row.

Acceptance criteria

  • When a report is stored, a normalised hash of the report text (whitespace, dates and run ids normalised) is saved on the run, together with a report_novelty value: new, unchanged (same hash as the previous reported run of the definition) or empty (below a minimum length).
  • For acting runs, the number of mutating MCP operations performed under the run's grant is captured before the grant is revoked and stored on the run; zero is recorded as a no-op acting step.
  • The run's state machine is unchanged: such runs still complete. The flags are additional columns exposed in the REST run payload, MCP get_automation_run / list_automation_runs, the CLI and the runs list UI (a visible "no change" badge).
  • After N consecutive unproductive scheduled runs (instance setting, default 3), the owner receives one Inbox notification naming the automation; it is not repeated until a productive run resets the streak.
  • An optional per-definition flag pauses the schedule automatically when the notification fires (default off), using the existing schedule-disable path with a clear reason.
  • Manual runs are flagged but do not count toward the streak.
  • Migration is reversible; existing runs have null flags.
  • Tests cover hashing and normalisation, the streak, the notification, the auto-pause and the acting-step count.

Implementation

Key files: src/jobs/processAgentRunJob.ts (report stored just before the report_ready transition; previousReportsFor), packages/core/src/services/agents/agentRunReports.ts (listPreviousReports), packages/core/src/services/agents/agentRunStore.ts, src/jobs/processAgentActionJob.ts, src/jobs/agentRuns/mcpGrantClient.ts (revokeGrantQuietly already receives calls), packages/api/mcp/accessLog.ts, mcp_operations table, packages/core/src/services/agents/agentDefinitionStore.ts (disableAgentDefinitionSchedule), src/jobs/agentRuns/autonomy.ts (notification precedent), packages/api/routes/automationDefinitionRoutes.ts (publicAutomationRun), packages/api/mcp/toolsAutomations.ts, propr-ui/src/components/Agents/. Verify with npm run test:prepare, npm run typecheck, the changed test files via node scripts/run-test-suite.mjs, and eslint --max-warnings 0 per touched package.

Activity

  1. propr-dev commented on Nov 11, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3442/claude-opus-5-5-flag-automation-runs-that-20261111-2200-km0
    • Base Branch: main
    • Worktree: issue-3442-20261111-2200-claude-opus-5-5-km0

    🔍 Track Task Execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions