fix(oauth-keepalive): drop unsupported --silent flag from cron create

`hermes cron create` only accepts --name, --deliver, --repeat,
--skill, --script, --workdir. The `silent: Bool?` field on
HermesCronJob exists in the JSON model but isn't exposed through
the CLI's create verb today — argparse rejected the unknown flag,
non-zero exit, toggle failed with the generic CLI hint.

Drops the flag; the keepalive runs with Hermes's default delivery.
Token-refresh side effect during session boot is unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alan Wizemann
2026-05-04 15:33:25 +02:00
parent 3271391506
commit fa15634381
@@ -81,12 +81,19 @@ final class OAuthKeepaliveCronService {
@discardableResult
nonisolated func enable() async -> Bool {
if isEnabled() { return true }
// `hermes cron create` only accepts: --name, --deliver,
// --repeat, --skill, --script, --workdir. The `silent: Bool?`
// field on HermesCronJob is JSON-only (Hermes can write it,
// but the CLI's create verb doesn't expose a flag for it).
// Pass any unknown flag and argparse rejects the whole
// command, so stick to the supported surface and let Hermes
// pick its default delivery target the side effect we care
// about (token refresh during session boot) fires regardless.
let result = await Task.detached { [fileService] in
fileService.runHermesCLI(
args: [
"cron", "create",
"--name", Self.jobName,
"--silent",
Self.defaultSchedule,
Self.defaultPrompt,
],