Skip to content

Rename schedule_executions table and fix vocabulary confusion #93

Closed

Description

@vybe

Problem

The same concepts have different names throughout the codebase, causing confusion:

Table Naming

The schedule_executions table stores ALL execution types (manual tasks, public chat, paid chat, MCP calls, scheduled runs) despite its name implying schedules only. The schedule_id column uses "__manual__" as a magic sentinel for non-scheduled executions.

Vocabulary Chaos

Concept Names Used Where
A headless agent run "task", "execution", "parallel task", "headless execution" UI says "Tasks", DB is schedule_executions, service is TaskExecutionService
The DB record "execution", "task_execution", "schedule_execution" create_task_execution() writes to schedule_executions
Execution ID execution_id, task_execution_id, id (queue), schedule_execution_id Different names per router
Claude Code session session_id, resume_session_id, claude_session_id Three names, same concept
Who started it triggered_by, source Values: schedule, manual, mcp, agent, public, paid

Required Changes

  1. Rename table: schedule_executions → task_executions (with migration)
  2. Make schedule_id nullable instead of using "__manual__" sentinel
  3. Standardize ID naming: Use execution_id everywhere (not task_execution_id)
  4. Standardize session naming: Use claude_session_id for Claude Code sessions, execution_id for our tracking
  5. Add execution_type column: chat | task | schedule | public | paid to distinguish execution origins cleanly
  6. Update all references across backend, scheduler, frontend, and MCP server

Impact

  • Database migration required (rename + add column)
  • All Python code referencing schedule_executions must update
  • Frontend API calls must update
  • Scheduler database layer must update

Files to Change

  • src/backend/db/schema.py — table rename + migration
  • src/backend/db/schedules.py — all query methods
  • src/backend/database.py — delegation methods
  • src/scheduler/database.py — scheduler DB layer
  • src/backend/routers/chat.py — ID references
  • src/backend/routers/schedules.py — execution queries
  • src/backend/services/task_execution_service.py — creation calls
  • src/frontend/src/stores/agents.js — API calls

Activity

  1. added
    priority-p1
    on Mar 11, 2026
  2. vybe commented on Mar 12, 2026

    @vybe
    ContributorAuthor

    Closing: Table rename deferred. The vocabulary confusion (#92) was addressed by standardizing TaskExecutionStatus enum. The table remains schedule_executions — a more invasive rename was deemed unnecessary after #92 solved the core status value inconsistency.

  3. added
    complexity-low
    on Jun 3, 2026
  4. rgsaura commented on Nov 20, 2026

    @rgsaura

    Owner decision on the reviewer-flagged residual (hint-endpoint enumeration differential): accept the small signal in favor of the better hint UX (password-advertising accounts distinguishable from unknown/email-code-only addresses). The uniform-hint alternative is rejected for now; revisit only if enumeration concerns escalate.

    #93 remains open until the sign-in preference ships (target v1.7.28) and is verified live.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions