fix(scheduled-task): keep Agent tasks visible in Maka catalog - #5737
Conversation
hqhq1025
left a comment
There was a problem hiding this comment.
This change preserves and validates execution.toolMode across ScheduledTask protocol mutations and catalog reads, and re-reads the Host catalog after model-created tasks. I reviewed the decoder, creation path, Host workspace resolution, and added tests. Node 24 install/build, 38 focused tests, runtime/runtime-host typechecks, Biome, and diff check passed locally. I did not reproduce the Desktop UI flow or packaged Host behavior.
P2: See the inline finding about valid filesystem-root sessions now being unable to create Agent/resume tasks. The PR also currently conflicts with main in packages/runtime-host/src/protocol/index.ts (main epoch 189 versus this branch 178) and packages/runtime/src/scheduled-task-tools.ts (main added Host clock/time-zone output); resolve both and revalidate the merged behavior. Only the label check is currently reported on this head, so merge readiness is not established.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
4da07a2 to
75838a4
Compare
hqhq1025
left a comment
There was a problem hiding this comment.
On this rebased head, the ScheduledTask decoder preserves and validates Agent toolMode, and the model tool verifies a created task by reading the Host catalog. The compatibility epoch advances from main 189 to 190, and the mainline Host clock/time-zone output remains intact. I reviewed the full five-file diff, protocol/query and Host workspace paths, plus the new tests. Node 24 install/build, 41 focused tests, runtime/runtime-host typechecks, Biome, and diff check passed; current-head CI test is green and the branch is mergeable.
P2 remains in the inline finding: a valid filesystem-root Host session can no longer create resume or Agent scheduled tasks. This is not ready to merge until that policy mismatch is resolved. I did not independently run the Desktop catalog UI or packaged Host end-to-end.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
Generated-by: Codex
75838a4 to
7d29b0e
Compare
hqhq1025
left a comment
There was a problem hiding this comment.
I reviewed the five-file diff on this head, including the new change to the ScheduledTask model-tool cwd guard, protocol read/write handling for Agent toolMode, Host catalog verification, and their tests. The previous P2 is addressed: the tool now rejects only missing cwd for non-notification effects, so an existing filesystem-root Host workspace can reach task creation; the new root-workspace regression test passes. The compatibility epoch is 190, and the Host clock/time-zone output from main remains intact. I found no further substantiated P0–P3 issue in the reviewed paths.
Node 24 build, 40 focused tests, runtime typecheck, Biome, diff check, and merge-tree passed locally. The current-head CI test is green and GitHub reports the PR mergeable. I did not independently run the Desktop catalog UI or a packaged Host end-to-end; a Host catalog read alone does not prove a Desktop connected to a different Host rendered the task. Final merge decision remains with a human reviewer.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
|
Non-blocking review note on the creation confirmation: |
likun666661
left a comment
There was a problem hiding this comment.
Approved on head 7d29b0e. The protocol decoder now preserves and validates optional Agent toolMode across mutation and catalog read paths, with legacy omission covered; the earlier root-workspace regression is addressed. No substantiated P1/P2 blocker remains in the reviewed diff. My non-blocking note on the scope of the post-create store readback is in the PR conversation; this approval does not claim an independent final-head Desktop E2E or a scheduled firing test.
Watermark bfb315a. Done: apache#5573/apache#5600/apache#5601, apache#5521, apache#4875, apache#5723, apache#5738, apache#5742. Not applicable: apache#5737, apache#5593. Deferred: apache#5730. Consider: apache#5599, apache#5120, apache#5693. Diverged: apache#5740. Skipped: ACP, WorkHub, upstream renderer and packages/ui, one refactor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Summary
Agent-created scheduled tasks persist
execution.toolMode, but the Runtime Host ScheduledTask decoder rejected that field. Catalog queries could therefore returninternal_failure, leaving Maka's Scheduled tasks page empty or stale even though the task had been stored.Preserve and validate optional
toolModeacross 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
0 9 * * 5and next run2026-10-02 09:00in Asia/Shanghai. The same Runtime Host query returnedtoolMode: directand the expected project working directory. This verifies creation and catalog visibility; it does not verify a future scheduled firing.@maka/core,@maka/storage,@maka/runtime, and@maka/runtime-hostsuccessfully.git diff --check, and the protocol epoch check against upstream main passed.AI use
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: Codextrailer.Checklist
Does this PR entail a change in behavior?