Skip to content

feat: support cloud scheduled task execution#37

Merged
glittercowboy merged 2 commits intomainfrom
codex/cloud-scheduled-tasks
Apr 25, 2026
Merged

feat: support cloud scheduled task execution#37
glittercowboy merged 2 commits intomainfrom
codex/cloud-scheduled-tasks

Conversation

@glittercowboy
Copy link
Copy Markdown
Contributor

@glittercowboy glittercowboy commented Apr 25, 2026

Summary

  • advertises daemon support for task origin metadata and stop messages in hello capabilities
  • logs scheduled task origin/run IDs for task correlation
  • keeps the daemon-local cron scheduler behind GSD_DAEMON_LOCAL_CRON_SCHEDULER=1 while cloud worker scheduling owns recurring execution

Verification

  • GOWORK=off go test ./...
  • GOWORK=off go build -o gsd-cloud .

Dependency / Release

  • Uses github.com/gsd-build/protocol-go v0.13.0.
  • Runtime release requires the daemon tag/workflow after merge.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

The PR updates the protocol-go dependency and introduces task origin tracking. Changes include conditional cron scheduling via environment variable gate, relay capability advertisement, and enhanced logging with task origin metadata (kind, scheduled task ID, run ID) across logging, relay, and session components.

Changes

Cohort / File(s) Summary
Dependency Update
go.mod
Updates github.com/gsd-build/protocol-go dependency to a newer pseudo-version.
Logging Enhancements
internal/logging/context.go, internal/logging/context_test.go
Augments TaskAttrs to conditionally include task origin metadata (taskOrigin, scheduledTaskId, scheduledRunId) when task.Origin is present. Adds test verifying origin field extraction.
Cron Scheduling Gate
internal/loop/daemon.go, internal/loop/daemon_test.go
Introduces environment-based conditional (GSD_DAEMON_LOCAL_CRON_SCHEDULER == "1") to control cron scheduler startup via localCronSchedulingEnabled() helper. Adds test validating behavior based on environment variable.
Relay Capabilities
internal/relay/conn.go, internal/relay/conn_test.go
Sets protocol.Hello.Capabilities in relay handshake to advertise TaskOrigin and Stop support. Updates test to validate capability fields presence and correctness.
Task Execution Logging
internal/session/actor.go
Conditionally emits task origin metadata in executeTask logging when incoming protocol.Task.Origin is non-nil.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 With origins traced and tasks now named,
Our scheduling dances, conditionally tamed,
Capabilities broadcast through relay's embrace,
Every hop logged with time and place! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding support for cloud scheduled task execution, which aligns with all file modifications including task origin logging, capability advertisement, and cron scheduler gating.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cloud-scheduled-tasks

Comment @coderabbitai help to get the list of available commands and usage tips.

@glittercowboy glittercowboy merged commit 5a0bd2f into main Apr 25, 2026
2 checks passed
@glittercowboy glittercowboy deleted the codex/cloud-scheduled-tasks branch April 26, 2026 22:26
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