← Back to Pull requests

fix(scheduled-task): keep Agent tasks visible in Maka catalog #5737

Closed
unknown closed this pull request without merging on Sep 26, 2026 14:35 UTC
View on GitHub
unknown unknown commented on Sep 26, 2026 06:32 UTC
Author

Summary

Agent-created scheduled tasks persist execution.toolMode, but the Runtime Host ScheduledTask decoder rejected that field. Catalog queries could therefore return internal_failure, leaving Maka's Scheduled tasks page empty or stale even though the task had been stored.

Preserve and validate optional toolMode across task mutations and catalog reads, including legacy records that omit it. Advance the compatibility epoch from 189 to 190 because older peers reject the field. Preserve the latest upstream time and time-zone formatting.

The ScheduledTask tool now checks the same Host catalog for the newly created ID before reporting success. If verification fails, it reports the task ID and advises querying before retrying to avoid duplicates. Agent task creation rejects only missing or whitespace-only working directories, while valid Host paths including filesystem root remain supported. Successful creation reports the stored Agent execution directory.

Verification

  • Before rebasing, verified the actual Dev UI with an isolated test profile: the weekly report appeared as an Agent scheduled task with cron 0 9 5 and next run 2026-10-02 09:00 in Asia/Shanghai. The same Runtime Host query returned toolMode: direct and the expected project working directory. This verifies creation and catalog visibility; it does not verify a future scheduled firing.

  • After rebasing onto current upstream main, built @maka/core, @maka/storage, @maka/runtime, and @maka/runtime-host successfully.

  • All 35 affected tests passed:

  •   node --test packages/runtime-host/dist/__tests__/scheduled-task-protocol.test.js packages/runtime/dist/__tests__/scheduled-task-tools.test.js packages/core/dist/__tests__/scheduled-task.test.js
      

  • Added a regression test confirming a filesystem-root workspace can create an Agent scheduled task.

  • Biome checks on the changed files, git diff --check, and the protocol epoch check against upstream main passed.

  • The full repository test suite was not run.
  • AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Codex assisted with diagnosis, implementation, regression tests, Dev UI verification, review response, and conflict resolution. The commit includes a Generated-by: Codex trailer.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • Diff: 323 lines (+242 / -81) across 4 files Reviewer: liugddx Review duration: 483m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 323 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.346
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5737"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.0% (MEDIUM) · Higher = larger blast radius
    42.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.6% · Safe to merge
    16.6%
    Repository