Skip to content

daily-start / daily-end を bot assist の automation に移す - #216

Merged
wwwyo merged 1 commit into
mainfrom
wwwyo/daily-start-to-orca
Nov 22, 2026
Merged

wwwyo merged 1 commit into
mainfrom
wwwyo/daily-start-to-orca

Conversation

@wwwyo

@wwwyo wwwyo commented Nov 22, 2026

Copy link
Copy Markdown
Owner

何を変えるか

daily-start(毎日 08:00 JST)と daily-end(毎日 23:00 JST)を、project automation(provider=pi・workspace=wwwyo/me・reuse_session)から bot assist の automation に移す。CLI だけで移すと、次の sync_automations.py apply が名前照合で旧 project automation を作り直すか、bot automation に --provider / --workspace を送って壊す。そこで SSOT 側(manifest と sync script)から直す。

sync_automations.py の schema 追加(bot automation)

key 意味
bot bot 名(orca bot list の name)。あると bot automation になる
agent / model / effort 任意。bot の既定以外で走らせるとき。どれも runs_in = "new" が必須(orca 側の制約)
runs_in new(default)/ chat / chat:<id>
results_to chat(default)/ thread / none / channel:<ch> / linear:<issue>
workdir prompt の {{workdir}} を展開するためだけの path(~ 可)。orca には送らない
  • bot と一緒に provider / workspace_path / repo_path / reuse_session / extra_agent_args を書くと、load_manifest で error にする。bot 専用 key を project manifest に書いた場合も error にする
  • drift 判定は live の実物(orca automations show --json)に合わせた: bot.botId(bot 名は orca bot list で ID に解決)・bot.runsIn・bot.resultsTo・bot.agentSetup.agent・bot.agentSetup.launch.model・bot.agentSetup.launch.options.effort
  • KIND MISMATCH: 同名でも live が project で manifest が bot(またはその逆)の場合。orca automations edit では種類を変えられないため、check はこれを明示して exit 1、apply は新しい種類を 先に create し、成功してから旧を remove する(create が失敗しても旧は残る)。remove は旧の run history も消す
  • 実測した edit の挙動: 同じ --agent を再指定しても live の model / effort は残り、--agent bot で初めて消える。そのため manifest から model / effort を外したときは、--agent bot を挟んでから edit する

daily-start / daily-end の manifest

  • bot = "assist"、agent = "pi"(個人データを扱うので従来どおり pi)、runs_in = "new"、results_to = "chat"。時刻と timezone は変えない
  • bot は自分のフォルダ(~/.orca/bots/assist)で走る。pi は起動した cwd から project skill を探すので、wwwyo/me の skill は自動では見つからない。prompt で {{workdir}}(= ~/src/github.com/wwwyo/me)への移動を指示し、AGENTS.md と .agents/skills/<name>/SKILL.md のパスも明示した
  • reuse_session は bot では使えない。terminal を残す目的で入れていたことはコメントに残し、bot では毎回新しい会話になる(結果は bot の chat に残る)と書いた
  • daily-end の「無人実行なので質問しない・end.md に対話なしと記す」は残した。「reuse session が対話端末でも」の前提は無くなったので削った

検証

  • probe probe-bot-pi(--bot assist --agent pi --runs-in new --results-to chat --trigger "*/3 * * * *"): 11:24 JST に scheduled run が completed になり、出力は "probe ok"。nextRunAt は 11:24 → 11:27 に進んだ。pi の session は ~/.pi/agent/sessions/--Users-…-.orca-bots-assist-- に記録され、pi が bot フォルダで動いたことも確認した
  • 別名の使い捨て manifest probe-sync-x で、この PR の script の apply 経路を一通り通した。project → bot の KIND MISMATCH(create → 旧 remove)、model/effort の追加、model/effort の削除(--agent bot を挟む経路)、agent の削除。どの段階でも、apply 後の check は in sync・rc=0 になった。daily trigger の bot automation が FREQ=DAILY;BYHOUR=4;BYMINUTE=44 になり、nextRunAt が翌 04:44 に入ることも確認した
  • probe は 2 つとも削除済み。live の daily-start / daily-end には触っていない
  • 現在の check: daily-start / daily-end は KIND MISMATCH + MISSING bot automation、他は in sync
  • tests/scheduled-tasks-bot-manifest.test.sh を追加した(daily-* が bot assist + pi + wwwyo/me の SKILL.md を指すこと、bot 用の flag への変換、両立しない組み合わせの拒否)

マージ後の手順(live への反映はマージまで行わない)

今夜 23:00 の daily-end を旧 automation のまま動かすため、apply はマージ後に行う。

cd ~/src/github.com/wwwyo/dotfiles && git pull
python3 .agents/scheduled-tasks/tools/sync_automations.py check daily-end   # KIND MISMATCH + MISSING を確認
python3 .agents/scheduled-tasks/tools/sync_automations.py apply daily-start
python3 .agents/scheduled-tasks/tools/sync_automations.py apply daily-end
python3 .agents/scheduled-tasks/tools/sync_automations.py check            # 全部 in sync
orca automations list --json   # 新しい daily-* が bot.botId=assist・agentSetup.agent=pi で、nextRunAt が次の 08:00 / 23:00 になっていること

23:00 の直前(数分前)に apply すると、その回が新旧どちらでも走らない窓ができうる。23:00 の run が終わってからか、日中に apply すること。

衝突・影響

sync_automations.py に bot automation(bot / agent / model / effort /
runs_in / results_to / workdir)を足し、同名で種類が違う live を
KIND MISMATCH として検出・apply で作り直す。
@orca-bots

orca-bots Bot commented Nov 22, 2026

Copy link
Copy Markdown

Auto Approve

Working…

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04a49102-bf55-469e-b8dd-30478fa79542
Commits

Reviewing files that changed from the base of the PR and between 13235fc and 64733a8.

Files selected for processing: 4

  • .agents/scheduled-tasks/daily-end/automation.toml
  • .agents/scheduled-tasks/daily-start/automation.toml
  • .agents/scheduled-tasks/tools/sync_automations.py
  • tests/scheduled-tasks-bot-manifest.test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 新たな指摘はありません。

Approach: 妥当です。CLI で automation を移すだけでは次回の sync_automations.py apply が旧 project automation を作り直すか、bot automation に --provider や --workspace を送って壊します。この PR は manifest と sync script の SSOT 側から直しているので、原因に対する修正になっています。

Reviewed changes — 差分全体(4 ファイル)を読み、sync_automations.py の create / edit / remove の分岐と drift 判定を手で追いました。

  • daily-start / daily-end の manifest: bot = "assist"、agent = "pi"、runs_in = "new" に変更しました。{{workdir}} は ~ 形式のまま展開されるため、repo にユーザー名は入りません。prompt では AGENTS.md と SKILL.md のパスを明示しています。
  • sync_automations.py の bot schema: load_bot_manifest が bot と両立しない key を弾き、runs_in の値と、agent / model / effort に runs_in = "new" が必要な制約を検査します。逆に project manifest に bot 専用 key があっても error にします。
  • flag 生成と drift 判定の共通化: _schedule_flags と _precheck_flags を切り出し、bot_flags / bot_drifts を追加しました。--bot は create のときだけ送り、edit では送りません。
  • KIND MISMATCH の apply: 新しい種類を先に create し、成功してから旧を remove します。create が失敗しても旧は残ります。
  • model / effort を外すときの edit: --agent bot を挟んでから edit します。PR 本文の実測結果と矛盾しないことを確認しました。
  • tests/scheduled-tasks-bot-manifest.test.sh: daily-* の manifest が bot の flag に変換されること、両立しない key の拒否を検査します。

P3(承認を妨げません): same が複数並んだ場合(bot を変えた作り直しの途中)は、先頭 1 件だけを drift 判定し、残りは check に表示されません。通常運用では起きない状態なので、対応は不要です。

観点別の独立検証(reviewfrog subagent の dispatch)は、今回の run では行っていません。差分全体と周辺コードは親が直接確認しました。可搬性(ユーザー名入りの絶対パス、OS 分岐)の観点では、新たなハードコードや、local 値を巻き戻す変更は見つかりませんでした。live への反映はマージ後の手順どおりに進めるもので、#202 との衝突も PR 本文に記載済みです。

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@wwwyo
wwwyo marked this pull request as ready for review November 22, 2026 02:32
@wwwyo
wwwyo merged commit ffc42a2 into main Nov 22, 2026
9 checks passed
@wwwyo
wwwyo deleted the wwwyo/daily-start-to-orca branch November 22, 2026 02:32
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