Repository navigation
Conversation
Enable the AGENT_TRIGGERS feature flag to unlock CronCreate, CronDelete, and CronList tools for all open-build users. The cron scheduling implementation is complete and production-ready: - CronCreateTool (src/tools/ScheduleCronTool/CronCreateTool.ts) - CronDeleteTool (src/tools/ScheduleCronTool/CronDeleteTool.ts) - CronListTool (src/tools/ScheduleCronTool/CronListTool.ts) - Persistence via .claude/scheduled_tasks.json - Local scheduler with missed-task detection - Kill-switch: CLAUDE_CODE_DISABLE_CRON=1 The GrowthBook runtime gate (tengu_kairos_cron) defaults to true via the no-telemetry stub, so this works out of the box.
There was a problem hiding this comment.
Pull request overview
Enables the open-build compile-time feature flag for agent triggers so cron scheduling tools (CronCreate, CronDelete, CronList) and related scheduling surfaces can be included in the bundled CLI.
Changes:
- Turn on the
AGENT_TRIGGERSopen-build feature flag in the Bun bundling shim. - As a result, cron scheduling modules/tools that are already runtime-gated can be shipped in the open build.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey, can you check PR #621, I think it already solves what youre looking for, and even possibly enhance. |
|
Hey @khaledmoayad, thanks for the pointer! I took a look at #621 — nice work on the For the cron activation specifically, this PR is part of a broader stack I'm working on to systematically open up the build:
The build flag flip in #633 combined with the local flag reader in #639 gives users full control over both the compile-time and runtime layers — so the That said, your |
The cron activation layer (AGENT_TRIGGERS guard removal, isKairosCronEnabled hardcode) is covered by an in-flight stack (Twigpine#633, Twigpine#639). Scope this PR to just the loop.ts rewrite and its tests so it can land cleanly on top.
|
Makes sense — I've stripped the infra changes from #621 and scoped it to just the Would love a review on the skill logic when you get a chance! |
|
Heads up on something I hit while testing #621 that's relevant here. Bun's constant folder evaluates This affects the cron tools in Because of this, I've updated #621 to remove the |
|
Thanks for the thorough investigation on the Bun cache issue @khaledmoayad — that was a really good catch. Good news: PR #657 addresses this exact problem by replacing the I'll take a look at #621 for the loop rewrite — happy to review it once #657 lands so we have a clean foundation for the flag system. |
|
Checked #657 — nice fix, the pre-processing approach is much cleaner than fighting Bun's native resolver. Good to know the shim was fully broken rather than just a caching quirk. Our PRs don't conflict (different files), so #621 can land independently either way. The approach we ended up with — removing the build-time guards and using |
* feat: implement /loop command with fixed and dynamic scheduling modes Enable cron tools and /loop skill without the AGENT_TRIGGERS build flag by removing feature guards from tools.ts, REPL.tsx, and skill registration. The isKairosCronEnabled() runtime gate now enables cron unconditionally for open builds while preserving the GrowthBook kill switch for ant builds. The /loop skill supports four modes: fixed-interval with prompt, fixed-interval maintenance, dynamic-prompt (self-pacing), and dynamic maintenance (bare /loop). * chore: remove unused DEFAULT_INTERVAL constant from loop skill * revert: drop infra changes, scope PR to /loop skill rewrite only The cron activation layer (AGENT_TRIGGERS guard removal, isKairosCronEnabled hardcode) is covered by an in-flight stack (#633, #639). Scope this PR to just the loop.ts rewrite and its tests so it can land cleanly on top. * fix: restore infra changes needed for /loop in open build Bun's constant folder evaluates feature('AGENT_TRIGGERS') at bundle time through the bun:bundle shim — even when the flag is flipped to true in build.ts, the folded value is cached from the previous build and stays false. This means the feature-gated require() blocks for cron tools, useScheduledTasks, and loop skill registration all compile to dead code regardless of the flag. Fix by removing the AGENT_TRIGGERS guards from the specific paths /loop needs: - tools.ts: cron tools always registered (isEnabled gates visibility) - REPL.tsx: useScheduledTasks always mounted - index.ts: registerLoopSkill via static import, called unconditionally - prompt.ts: isKairosCronEnabled() bypasses feature flag for non-ant builds * fix: replace backslash line continuations with explicit delimiters in loop prompts The backslash-newline sequences inside template literals were acting as line continuations, collapsing newlines and merging prompt content with surrounding instruction text. Replace with --- BEGIN/END --- markers for unambiguous delimiting. Also add tests for trailing "every" clause parsing, human-readable unit normalization, and the non-interval "check every PR" case. * fix: remove remaining AGENT_TRIGGERS guards from print.ts and constants/tools.ts Completes the cron guard removal started in the previous commit. The cron scheduler in non-interactive (-p) mode was dead because print.ts still gated cronSchedulerModule/cronGate requires behind feature('AGENT_TRIGGERS'), which Bun constant-folds to false in open builds. Similarly, cron tool names were absent from IN_PROCESS_TEAMMATE_ALLOWED_TOOLS. Remove all three guards so the scheduler initialises (gated at runtime by isKairosCronEnabled) and cron tools are allowed for in-process teammates in all builds.
…#633) Consolidates PRs Twigpine#667 and Twigpine#633: - Activate 18 build-time flags: KAIROS, BRIDGE_MODE, AGENT_TRIGGERS, ULTRATHINK, TOKEN_BUDGET, HISTORY_PICKER, EXTRACT_MEMORIES, etc. - Add _openBuildDefaults in GrowthBook stub for runtime gate overrides: bridge flags (tengu_ccr_bridge, tengu_bridge_repl_v2), KAIROS flags (tengu_kairos, tengu_kairos_brief), feature flags (AWAY_SUMMARY, VERIFICATION_AGENT, EXTRACT_MEMORIES) - Priority: ~/.claude/feature-flags.json > _openBuildDefaults > defaultValue
|
Hello @Flo5k5 this is good direction kindly please rebase to main and fix conflicts so we can start review |
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Review: PR #633 — Activate agent triggers (cron scheduling) in open build (head ee57240)
CI green ✅. 1 file, +1/-1.
Assessment
Flips AGENT_TRIGGERS feature flag from false to true in scripts/build.ts. This enables cron scheduling in the open build.
The feature code is already fully implemented and gated behind this flag. The implementation was reviewed as part of prior PRs. This is a standard feature-flag activation flip — same class as PR #632 (DAEMON flag), PR #621 (AGENT_TRIGGERS initial code), etc.
Note
Per our learning from PR #621: Bun's constant folder evaluates feature() at bundle time and caches the result. This build-time flip is the correct way to activate the feature for the open build. Any GrowthBook runtime gates would need separate handling, but AGENT_TRIGGERS doesn't have a secondary GrowthBook gate.
Verdict: Approve-ready ✅
Low-risk feature flag activation. Code is already implemented and gated; this just turns it on.
|
hello @Flo5k5 please resolve conflicts |
gnanam1990
left a comment
There was a problem hiding this comment.
I understand the motivation, but this PR is still effectively a feature enablement switch rather than a narrow bug fix. Flipping AGENT_TRIGGERS on for the open build exposes cron scheduling behavior to all users, and I don’t think the current branch provides enough open-build-specific validation for that rollout. I’d want a stronger behavior, safety, and UX validation story before enabling this globally.
…pine#621) * feat: implement /loop command with fixed and dynamic scheduling modes Enable cron tools and /loop skill without the AGENT_TRIGGERS build flag by removing feature guards from tools.ts, REPL.tsx, and skill registration. The isKairosCronEnabled() runtime gate now enables cron unconditionally for open builds while preserving the GrowthBook kill switch for ant builds. The /loop skill supports four modes: fixed-interval with prompt, fixed-interval maintenance, dynamic-prompt (self-pacing), and dynamic maintenance (bare /loop). * chore: remove unused DEFAULT_INTERVAL constant from loop skill * revert: drop infra changes, scope PR to /loop skill rewrite only The cron activation layer (AGENT_TRIGGERS guard removal, isKairosCronEnabled hardcode) is covered by an in-flight stack (Twigpine#633, Twigpine#639). Scope this PR to just the loop.ts rewrite and its tests so it can land cleanly on top. * fix: restore infra changes needed for /loop in open build Bun's constant folder evaluates feature('AGENT_TRIGGERS') at bundle time through the bun:bundle shim — even when the flag is flipped to true in build.ts, the folded value is cached from the previous build and stays false. This means the feature-gated require() blocks for cron tools, useScheduledTasks, and loop skill registration all compile to dead code regardless of the flag. Fix by removing the AGENT_TRIGGERS guards from the specific paths /loop needs: - tools.ts: cron tools always registered (isEnabled gates visibility) - REPL.tsx: useScheduledTasks always mounted - index.ts: registerLoopSkill via static import, called unconditionally - prompt.ts: isKairosCronEnabled() bypasses feature flag for non-ant builds * fix: replace backslash line continuations with explicit delimiters in loop prompts The backslash-newline sequences inside template literals were acting as line continuations, collapsing newlines and merging prompt content with surrounding instruction text. Replace with --- BEGIN/END --- markers for unambiguous delimiting. Also add tests for trailing "every" clause parsing, human-readable unit normalization, and the non-interval "check every PR" case. * fix: remove remaining AGENT_TRIGGERS guards from print.ts and constants/tools.ts Completes the cron guard removal started in the previous commit. The cron scheduler in non-interactive (-p) mode was dead because print.ts still gated cronSchedulerModule/cronGate requires behind feature('AGENT_TRIGGERS'), which Bun constant-folds to false in open builds. Similarly, cron tool names were absent from IN_PROCESS_TEAMMATE_ALLOWED_TOOLS. Remove all three guards so the scheduler initialises (gated at runtime by isKairosCronEnabled) and cron tools are allowed for in-process teammates in all builds.
|
closing as stale |
…pine#621) * feat: implement /loop command with fixed and dynamic scheduling modes Enable cron tools and /loop skill without the AGENT_TRIGGERS build flag by removing feature guards from tools.ts, REPL.tsx, and skill registration. The isKairosCronEnabled() runtime gate now enables cron unconditionally for open builds while preserving the GrowthBook kill switch for ant builds. The /loop skill supports four modes: fixed-interval with prompt, fixed-interval maintenance, dynamic-prompt (self-pacing), and dynamic maintenance (bare /loop). * chore: remove unused DEFAULT_INTERVAL constant from loop skill * revert: drop infra changes, scope PR to /loop skill rewrite only The cron activation layer (AGENT_TRIGGERS guard removal, isKairosCronEnabled hardcode) is covered by an in-flight stack (Twigpine#633, Twigpine#639). Scope this PR to just the loop.ts rewrite and its tests so it can land cleanly on top. * fix: restore infra changes needed for /loop in open build Bun's constant folder evaluates feature('AGENT_TRIGGERS') at bundle time through the bun:bundle shim — even when the flag is flipped to true in build.ts, the folded value is cached from the previous build and stays false. This means the feature-gated require() blocks for cron tools, useScheduledTasks, and loop skill registration all compile to dead code regardless of the flag. Fix by removing the AGENT_TRIGGERS guards from the specific paths /loop needs: - tools.ts: cron tools always registered (isEnabled gates visibility) - REPL.tsx: useScheduledTasks always mounted - index.ts: registerLoopSkill via static import, called unconditionally - prompt.ts: isKairosCronEnabled() bypasses feature flag for non-ant builds * fix: replace backslash line continuations with explicit delimiters in loop prompts The backslash-newline sequences inside template literals were acting as line continuations, collapsing newlines and merging prompt content with surrounding instruction text. Replace with --- BEGIN/END --- markers for unambiguous delimiting. Also add tests for trailing "every" clause parsing, human-readable unit normalization, and the non-interval "check every PR" case. * fix: remove remaining AGENT_TRIGGERS guards from print.ts and constants/tools.ts Completes the cron guard removal started in the previous commit. The cron scheduler in non-interactive (-p) mode was dead because print.ts still gated cronSchedulerModule/cronGate requires behind feature('AGENT_TRIGGERS'), which Bun constant-folds to false in open builds. Similarly, cron tool names were absent from IN_PROCESS_TEAMMATE_ALLOWED_TOOLS. Remove all three guards so the scheduler initialises (gated at runtime by isKairosCronEnabled) and cron tools are allowed for in-process teammates in all builds.
…pine#621) * feat: implement /loop command with fixed and dynamic scheduling modes Enable cron tools and /loop skill without the AGENT_TRIGGERS build flag by removing feature guards from tools.ts, REPL.tsx, and skill registration. The isKairosCronEnabled() runtime gate now enables cron unconditionally for open builds while preserving the GrowthBook kill switch for ant builds. The /loop skill supports four modes: fixed-interval with prompt, fixed-interval maintenance, dynamic-prompt (self-pacing), and dynamic maintenance (bare /loop). * chore: remove unused DEFAULT_INTERVAL constant from loop skill * revert: drop infra changes, scope PR to /loop skill rewrite only The cron activation layer (AGENT_TRIGGERS guard removal, isKairosCronEnabled hardcode) is covered by an in-flight stack (Twigpine#633, Twigpine#639). Scope this PR to just the loop.ts rewrite and its tests so it can land cleanly on top. * fix: restore infra changes needed for /loop in open build Bun's constant folder evaluates feature('AGENT_TRIGGERS') at bundle time through the bun:bundle shim — even when the flag is flipped to true in build.ts, the folded value is cached from the previous build and stays false. This means the feature-gated require() blocks for cron tools, useScheduledTasks, and loop skill registration all compile to dead code regardless of the flag. Fix by removing the AGENT_TRIGGERS guards from the specific paths /loop needs: - tools.ts: cron tools always registered (isEnabled gates visibility) - REPL.tsx: useScheduledTasks always mounted - index.ts: registerLoopSkill via static import, called unconditionally - prompt.ts: isKairosCronEnabled() bypasses feature flag for non-ant builds * fix: replace backslash line continuations with explicit delimiters in loop prompts The backslash-newline sequences inside template literals were acting as line continuations, collapsing newlines and merging prompt content with surrounding instruction text. Replace with --- BEGIN/END --- markers for unambiguous delimiting. Also add tests for trailing "every" clause parsing, human-readable unit normalization, and the non-interval "check every PR" case. * fix: remove remaining AGENT_TRIGGERS guards from print.ts and constants/tools.ts Completes the cron guard removal started in the previous commit. The cron scheduler in non-interactive (-p) mode was dead because print.ts still gated cronSchedulerModule/cronGate requires behind feature('AGENT_TRIGGERS'), which Bun constant-folds to false in open builds. Similarly, cron tool names were absent from IN_PROCESS_TEAMMATE_ALLOWED_TOOLS. Remove all three guards so the scheduler initialises (gated at runtime by isKairosCronEnabled) and cron tools are allowed for in-process teammates in all builds.
Summary
AGENT_TRIGGERSfeature flag (scripts/build.ts) to unlockCronCreate,CronDelete, andCronListtools for all open-build users.The cron scheduling implementation is complete and production-ready (600+ lines):
src/tools/ScheduleCronTool/CronCreateTool.ts— create recurring/one-shot taskssrc/tools/ScheduleCronTool/CronDeleteTool.ts— delete scheduled taskssrc/tools/ScheduleCronTool/CronListTool.ts— list active taskssrc/utils/cronTasks.ts— persistence via.claude/scheduled_tasks.jsonsrc/utils/cronScheduler.ts— local event loop with missed-task detectionsrc/utils/cronTasksLock.ts— multi-session lock coordinationThe GrowthBook runtime gate (
tengu_kairos_cron) defaults totruevia the no-telemetry stub, so this works out of the box. Kill-switch:CLAUDE_CODE_DISABLE_CRON=1.Test plan
bun run build— compiles successfullybun run smoke— smoke tests pass.claude/scheduled_tasks.jsonis createdCLAUDE_CODE_DISABLE_CRON=1disables the feature