feat(workspace): add idle-loop reflection pattern (Hermes/Letta shape, opt-in, ~90 LOC) - #205
Merged
Merged
Conversation
Today's multi-framework research (Hermes, Letta, Trigger.dev, Inngest, AG2,
Rivet, n8n, Composio, SWE-agent — see docs/ecosystem-watch.md) confirmed
that nobody runs while(true) per agent. The working patterns are:
(a) event-driven + hibernation (Hermes, Letta, Trigger.dev, Inngest)
(b) cron/user-triggered ephemeral runs (AG2, Rivet, n8n, SWE-agent)
Molecule AI is currently 100% in category (b). Observed team utilization:
~0.5% — agents idle 99.5% of the time because cron fires and CEO-typed
A2A are the only initiating signals. CEO's north-star is 24/7 iteration,
current cadence falls short.
This PR closes the gap by adding an in-workspace idle loop that wakes the
agent periodically ONLY when it has no active task. The shape is the
Hermes reflection-on-completion pattern combined with the Letta backlog-pull
pattern, collapsed into a ~60 LOC change in the workspace-template. Zero
new Go code. Zero new DB tables. Zero new API endpoints.
## How it works
1. `config.py` gets two new fields on WorkspaceConfig:
- `idle_prompt: str = ""` — the prompt to self-send when idle
- `idle_interval_seconds: int = 600` — how often to check (default 10 min)
Both support inline or file ref (matching the initial_prompt pattern).
2. `main.py` spawns an `_run_idle_loop()` asyncio task alongside the
existing initial_prompt task (same lifecycle hooks — cancelled in the
`finally:` of the server.serve() block).
3. The loop body:
a. Sleep interval
b. Check `heartbeat.active_tasks == 0` LOCALLY (no LLM call, no HTTP)
c. If idle → self-POST the idle_prompt via the existing /workspaces/{id}/a2a proxy
d. Loop
The agent's own concurrency control rejects the post if it becomes busy
between the check and the POST — that's the safety valve.
4. Gated on `config.idle_prompt` being non-empty. Default = "" = no loop.
Existing workspaces upgrade silently as no-ops until someone explicitly
opts in by setting idle_prompt in org.yaml (either defaults: or
per-workspace:).
## Cost analysis (from the research report)
- while(true) pattern: ~$93/day/org (12 agents × 12 thinks/hour × $0.027). Unshippable.
- Hermes reflection-on-completion: ~$0.45/day/org. Cost ∝ useful work.
- This PR's idle loop at 10-min cadence: upper bound 12 × 6/hour × 24h
× ~3k tokens × Sonnet rate ≈ $5/day/org PER ROLE, only if they're
genuinely idle every check. In practice far less because busy periods
skip the LLM call entirely (the active_tasks check is local).
## Rollout plan
Research report recommended rolling to ONE workspace first (Technical
Researcher) and measuring 24h of activity_logs before enabling for
all 12. This PR enables the mechanism; it does NOT add any default
idle_prompt to org-templates/molecule-dev/org.yaml. That's a follow-up
PR after this one lands and one workspace has been manually opted in
for measurement.
## Not touched in this PR
- No Go code (no new platform endpoint, no new DB columns)
- No org.yaml changes (zero-impact until someone opts in)
- No scheduler changes (the idle loop is a workspace concern, not a
scheduler concern — matches the research report's layering)
## Test plan
- [x] Python syntax check (ast.parse) on main.py + config.py
- [ ] Unit test: WorkspaceConfig parses idle_prompt / idle_interval_seconds from yaml
- [ ] Integration test: set idle_prompt on Technical Researcher, measure that
an A2A message is received every ~10 min while idle, and NOT received
while busy with a delegation
- [ ] Dogfood: enable on Technical Researcher for 24h, count activity_logs
delta vs baseline, confirm cost stays within model
## Related
- Today's research report (conversation output, summarized in commit trailer)
- docs/ecosystem-watch.md → `### Hermes Agent` (the canonical reflection-on-completion example)
- #159 orchestrator/worker split — complementary: leaders pulse for dispatch,
workers idle-loop for pull. Together: leaders push work, workers pull work,
no role ever sits idle with a cold queue.
HongmingWang-Rabbit
added a commit
that referenced
this pull request
Apr 15, 2026
…follow-up) PR #205 shipped the workspace idle-loop mechanism (reflection-on-completion pattern from the Hermes/Letta research survey) but deliberately added NO default idle_prompt in org.yaml so rollout could be measured one workspace at a time before going team-wide. This is that first opt-in: Technical Researcher gets a backlog-pull + reflect idle prompt on a 10-minute cadence. ## Why TR first - Research-heavy role with a naturally bursty load — lots of idle time between the once-per-hour plugin curation cron fires - Non-user-facing (no canvas UI impact, no UX risk) - Already has a clear backlog shape: the plugin curation cron produces findings that could feed follow-up studies - Vision-free (no Playwright) so cost per idle tick is pure text ## What the idle_prompt does Three-step reflection, under 60s wall-clock, max 1 A2A send per tick: 1. **Backlog pull** — search_memory "research-backlog:technical-researcher" for any stashed research questions (from prior cron fires or Research Lead delegations). If found → delegate_task to Research Lead with a concrete deliverable spec, then commit_memory to remove the item from the backlog. 2. **Reflection fallback** — if backlog is empty, look at the last memory entry from the Hourly plugin curation cron. Does it surface a follow-up study worth doing? If yes → file a GH issue labeled `research` and commit_memory to put the question on the backlog for next tick. 3. **Idle-clean outcome** — if neither backlog nor reflection produced anything, write "tr-idle HH:MM — clean" to memory and stop. No busy work. Hard rules enforce: max 1 A2A per tick, skip step 1 if Research Lead busy, under 60s wall-clock, never re-run a cron's own prompt from inside the idle loop. ## Rollout plan - **This PR**: enables TR only via the `idle_prompt` + `idle_interval_seconds` fields added to its workspace entry in org.yaml. - **Next 24h**: measure activity_logs delta on TR vs baseline, count idle-fired delegations vs idle-clean outcomes, confirm Research Lead isn't being flooded. - **If green** (delegations land useful work, no flood): roll to Market Analyst + Competitive Intelligence in a follow-up PR. - **If noisy** (too many idle fires producing nothing): tune idle_interval up to 1200-1800s. ## Apply locally per feedback rule Per `feedback_apply_template_locally_too.md`: not waiting for merge. After pushing this PR I'll edit TR's live /configs/config.yaml to add the same idle_prompt + idle_interval_seconds fields, then restart ws-57e13b54-119 (Technical Researcher) so the new workspace-template binary picks up the idle loop immediately. Measurement clock starts from that restart. ## Related - #205 (mechanism) — just merged in this cycle (54eb8d7) - #208 Hermes Phase 1 — also just merged (381a3c8) - docs/ecosystem-watch.md → `### Hermes Agent` — reflection-on-completion pattern reference
This was referenced Apr 15, 2026
HongmingWang-Rabbit
added a commit
that referenced
this pull request
Apr 15, 2026
chore(template): enable idle-loop pilot on Technical Researcher (#205 follow-up)
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Apr 15, 2026
… + idle loop Closes #220. #215 added auth_headers() to /registry/register but missed two other self-post paths from the same workspace container: 1. initial_prompt (_do_send_sync) — fires once on first boot after the A2A server is ready. Posts to /workspaces/:id/a2a via the platform proxy. Missing headers meant the initial prompt got silently dropped as 401 on any token-enrolled workspace. 2. idle loop (_post_sync) — fires every idle_interval_seconds while the workspace has no active task (#205 pattern). Same proxy path, same missing headers, same silent 401 in multi-tenant mode. Both now build headers as {"Content-Type": "application/json", **auth_headers()} auth_headers() returns {"Authorization": "Bearer <token>"} when /auth-token.txt exists, empty dict otherwise (first boot before register issues the token). The existing lazy-bootstrap fail-open on the platform side covers the empty-dict case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Apr 15, 2026
…ht sweep Captures ~27 PRs merged across both repos this session: security hardening cluster (#94/#99/#106/#110/#119/#162/#155/#167/#185/#200/#203/ #209/#233), data-integrity fixes (#212/#224/#236), CI runner migration (#186), platform/scheduler reliability (#95/#149/#207/#206), workspace runtime features (#205/#208/#198/#216/#225/#235/#231), code-review follow-ups (#228/#232). Updated counts: 816 Go (+70), 1180 Python (+40), 453 vitest (unchanged — UI/a11y patches), 97 jest (unchanged). CLAUDE.md additions: - Idle Loop section (#205) under Architectural Patterns - Admin auth middleware variants section linking docs/runbooks/admin-auth.md - Migration runner section explaining the .down.sql filter (#212) - Per-route auth notes in the API table (PATCH field-whitelist, CanvasOrBearer on PUT /canvas/viewport, AdminAuth on bundles/events/templates-import/ approvals-pending/admin-liveness) - Database section updated with workspace_auth_tokens auto-revoke (#110), scheduler.error_detail surfacing (#206), workspace_schedules.last_status 'skipped' state (#207) PLAN.md additions: - New Recently launched (overnight sweep) section with full PR/issue index - Phase status updated (B–G now complete, H partial) - Live infrastructure deltas (migration fix, token rotation, legal pages) - Outstanding items consolidated Edit-history file expanded from the tick-9 stub to a full session record covering malware cleanup, CI runner migration, security cluster, data integrity, infra/feature/code-review batches, and outstanding user actions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
added a commit
that referenced
this pull request
Apr 16, 2026
…lligence Rollout wave 2. Technical Researcher (wave 1, #216) has been the lone pilot since 2026-04-15. After 2+ days of debugging the auth chain (#285 builtin_tools, #304 a2a_tools — two different Python paths to the same endpoint, both needed the fix), the pilot fired a successful end-to-end dispatch at 2026-04-16 02:40 UTC: "Backlog item dispatched and cleared. Done in one A2A send. Step 1: Memory search found one..." Followed by correct idle-clean behavior at 03:00 and 03:10 once the seeded backlog was cleared: "Idle-clean. Backlog is empty, no new follow-ups to file." Pilot is validated. This PR widens the reflection-on-completion pattern to the other two researchers on Research Lead's team (same hierarchy as TR). ## Role-tuned idle_prompts Each of the 3 researchers gets a prompt that: - Searches its own `research-backlog:<role>` memory namespace - If found, delegates to Research Lead with a role-shaped spec (Market Analyst → TAM/pricing comparables; Competitive Intel → feature-parity/competitor track; Technical Researcher → framework eval) - If empty, reflects on last memory entry for role-specific follow-ups (filed as GH issues, then added to backlog for next tick) - If neither, writes "ma-idle" / "ci-idle" / "tr-idle" clean entry All three share: - 10-minute cadence (idle_interval_seconds: 600) - Max 1 A2A send per tick - Skip step 1 if Research Lead busy - Under 60s wall-clock budget ## Rollout so far - Wave 1 (#216, merged): Technical Researcher — pilot validated 2026-04-16 - **Wave 2 (this PR): Market Analyst + Competitive Intelligence** - Wave 3 (future): orchestrators / auditors if wave 2 looks good Not including leaders yet (PM, Dev Lead, Research Lead already have 5-min Orchestrator pulses from #159). Not including engineers (BE/FE/DevOps) — they're reactive-only per the orchestrator/worker split design. ## Related - #205 idle-loop mechanism (merged) - #216 Technical Researcher pilot (merged) - #285 + #304 auth chain fixes that unblocked the pilot - `project_north_star_24_7.md` memory — this is the "team runs 24/7" tick
HongmingWang-Rabbit
added a commit
that referenced
this pull request
Apr 16, 2026
Add Marketing Lead + 6 reports as a peer sub-tree of PM under the CEO: DevRel Engineer, Product Marketing Manager, Content Marketer, Community Manager, SEO Growth Analyst, Social Media / Brand. - Marketing Lead: tier-3 Opus CMO-equivalent with a 5-min orchestrator pulse (minutes 4/9/14/... offset from Dev Lead's 2/7/12/...) that dispatches cross-role work, reviews drafts, and routes cross-team asks back to PM. - DevRel + PMM: tier-3 Opus (technical writing + positioning judgment). Each has an idle_prompt for proactive issue-claim plus an hourly evolution cron (DevRel = sample-coverage audit, PMM = competitor diff against docs/ecosystem-watch.md). - Content / Community / SEO / Social: tier-2 Sonnet with idle_prompts for backlog-pull (matches the #205 idle-loop pattern proven on Technical Researcher + Market Analyst + Competitive Intelligence). Each has an hourly cron tuned to its surface. - category_routing gets 6 new keys (content, positioning, community, growth, social, devrel) so audit_summary messages fan out correctly. - Canvas positions lay out the marketing cluster to the right of PM/Dev Lead (x=1000-1300, y=50/250/400) so the graph stays readable. Each role also gets a system-prompt.md under its files_dir with responsibilities, team interfaces, conventions, and self-review gates (molecule-skill-llm-judge or molecule-hitl depending on risk). Per CEO directive 2026-04-16 ("comprehensive marketing team"). This is PR 1 of 2 — follow-up will add cross-tree A2A conventions and wire DevRel ↔ Backend Engineer / PMM ↔ Competitive Intelligence delegations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 tasks
HongmingWang-Rabbit
added a commit
that referenced
this pull request
Apr 16, 2026
Add Marketing Lead + 6 reports as a peer sub-tree of PM under the CEO: DevRel Engineer, Product Marketing Manager, Content Marketer, Community Manager, SEO Growth Analyst, Social Media / Brand. - Marketing Lead: tier-3 Opus CMO-equivalent with a 5-min orchestrator pulse (minutes 4/9/14/... offset from Dev Lead's 2/7/12/...) that dispatches cross-role work, reviews drafts, and routes cross-team asks back to PM. - DevRel + PMM: tier-3 Opus (technical writing + positioning judgment). Each has an idle_prompt for proactive issue-claim plus an hourly evolution cron (DevRel = sample-coverage audit, PMM = competitor diff against docs/ecosystem-watch.md). - Content / Community / SEO / Social: tier-2 Sonnet with idle_prompts for backlog-pull (matches the #205 idle-loop pattern proven on Technical Researcher + Market Analyst + Competitive Intelligence). Each has an hourly cron tuned to its surface. - category_routing gets 6 new keys (content, positioning, community, growth, social, devrel) so audit_summary messages fan out correctly. - Canvas positions lay out the marketing cluster to the right of PM/Dev Lead (x=1000-1300, y=50/250/400) so the graph stays readable. Each role also gets a system-prompt.md under its files_dir with responsibilities, team interfaces, conventions, and self-review gates (molecule-skill-llm-judge or molecule-hitl depending on risk). Per CEO directive 2026-04-16 ("comprehensive marketing team"). This is PR 1 of 2 — follow-up will add cross-tree A2A conventions and wire DevRel ↔ Backend Engineer / PMM ↔ Competitive Intelligence delegations. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
Closed
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
feat(workspace): add idle-loop reflection pattern (Hermes/Letta shape, opt-in, ~90 LOC)
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
…follow-up) PR #205 shipped the workspace idle-loop mechanism (reflection-on-completion pattern from the Hermes/Letta research survey) but deliberately added NO default idle_prompt in org.yaml so rollout could be measured one workspace at a time before going team-wide. This is that first opt-in: Technical Researcher gets a backlog-pull + reflect idle prompt on a 10-minute cadence. ## Why TR first - Research-heavy role with a naturally bursty load — lots of idle time between the once-per-hour plugin curation cron fires - Non-user-facing (no canvas UI impact, no UX risk) - Already has a clear backlog shape: the plugin curation cron produces findings that could feed follow-up studies - Vision-free (no Playwright) so cost per idle tick is pure text ## What the idle_prompt does Three-step reflection, under 60s wall-clock, max 1 A2A send per tick: 1. **Backlog pull** — search_memory "research-backlog:technical-researcher" for any stashed research questions (from prior cron fires or Research Lead delegations). If found → delegate_task to Research Lead with a concrete deliverable spec, then commit_memory to remove the item from the backlog. 2. **Reflection fallback** — if backlog is empty, look at the last memory entry from the Hourly plugin curation cron. Does it surface a follow-up study worth doing? If yes → file a GH issue labeled `research` and commit_memory to put the question on the backlog for next tick. 3. **Idle-clean outcome** — if neither backlog nor reflection produced anything, write "tr-idle HH:MM — clean" to memory and stop. No busy work. Hard rules enforce: max 1 A2A per tick, skip step 1 if Research Lead busy, under 60s wall-clock, never re-run a cron's own prompt from inside the idle loop. ## Rollout plan - **This PR**: enables TR only via the `idle_prompt` + `idle_interval_seconds` fields added to its workspace entry in org.yaml. - **Next 24h**: measure activity_logs delta on TR vs baseline, count idle-fired delegations vs idle-clean outcomes, confirm Research Lead isn't being flooded. - **If green** (delegations land useful work, no flood): roll to Market Analyst + Competitive Intelligence in a follow-up PR. - **If noisy** (too many idle fires producing nothing): tune idle_interval up to 1200-1800s. ## Apply locally per feedback rule Per `feedback_apply_template_locally_too.md`: not waiting for merge. After pushing this PR I'll edit TR's live /configs/config.yaml to add the same idle_prompt + idle_interval_seconds fields, then restart ws-57e13b54-119 (Technical Researcher) so the new workspace-template binary picks up the idle loop immediately. Measurement clock starts from that restart. ## Related - #205 (mechanism) — just merged in this cycle (7f11328) - #208 Hermes Phase 1 — also just merged (be53a33) - docs/ecosystem-watch.md → `### Hermes Agent` — reflection-on-completion pattern reference
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
chore(template): enable idle-loop pilot on Technical Researcher (#205 follow-up)
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
… + idle loop Closes #220. #215 added auth_headers() to /registry/register but missed two other self-post paths from the same workspace container: 1. initial_prompt (_do_send_sync) — fires once on first boot after the A2A server is ready. Posts to /workspaces/:id/a2a via the platform proxy. Missing headers meant the initial prompt got silently dropped as 401 on any token-enrolled workspace. 2. idle loop (_post_sync) — fires every idle_interval_seconds while the workspace has no active task (#205 pattern). Same proxy path, same missing headers, same silent 401 in multi-tenant mode. Both now build headers as {"Content-Type": "application/json", **auth_headers()} auth_headers() returns {"Authorization": "Bearer <token>"} when /auth-token.txt exists, empty dict otherwise (first boot before register issues the token). The existing lazy-bootstrap fail-open on the platform side covers the empty-dict case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
…ht sweep Captures ~27 PRs merged across both repos this session: security hardening cluster (#94/#99/#106/#110/#119/#162/#155/#167/#185/#200/#203/ #209/#233), data-integrity fixes (#212/#224/#236), CI runner migration (#186), platform/scheduler reliability (#95/#149/#207/#206), workspace runtime features (#205/#208/#198/#216/#225/#235/#231), code-review follow-ups (#228/#232). Updated counts: 816 Go (+70), 1180 Python (+40), 453 vitest (unchanged — UI/a11y patches), 97 jest (unchanged). CLAUDE.md additions: - Idle Loop section (#205) under Architectural Patterns - Admin auth middleware variants section linking docs/runbooks/admin-auth.md - Migration runner section explaining the .down.sql filter (#212) - Per-route auth notes in the API table (PATCH field-whitelist, CanvasOrBearer on PUT /canvas/viewport, AdminAuth on bundles/events/templates-import/ approvals-pending/admin-liveness) - Database section updated with workspace_auth_tokens auto-revoke (#110), scheduler.error_detail surfacing (#206), workspace_schedules.last_status 'skipped' state (#207) PLAN.md additions: - New Recently launched (overnight sweep) section with full PR/issue index - Phase status updated (B–G now complete, H partial) - Live infrastructure deltas (migration fix, token rotation, legal pages) - Outstanding items consolidated Edit-history file expanded from the tick-9 stub to a full session record covering malware cleanup, CI runner migration, security cluster, data integrity, infra/feature/code-review batches, and outstanding user actions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
Add Marketing Lead + 6 reports as a peer sub-tree of PM under the CEO: DevRel Engineer, Product Marketing Manager, Content Marketer, Community Manager, SEO Growth Analyst, Social Media / Brand. - Marketing Lead: tier-3 Opus CMO-equivalent with a 5-min orchestrator pulse (minutes 4/9/14/... offset from Dev Lead's 2/7/12/...) that dispatches cross-role work, reviews drafts, and routes cross-team asks back to PM. - DevRel + PMM: tier-3 Opus (technical writing + positioning judgment). Each has an idle_prompt for proactive issue-claim plus an hourly evolution cron (DevRel = sample-coverage audit, PMM = competitor diff against docs/ecosystem-watch.md). - Content / Community / SEO / Social: tier-2 Sonnet with idle_prompts for backlog-pull (matches the #205 idle-loop pattern proven on Technical Researcher + Market Analyst + Competitive Intelligence). Each has an hourly cron tuned to its surface. - category_routing gets 6 new keys (content, positioning, community, growth, social, devrel) so audit_summary messages fan out correctly. - Canvas positions lay out the marketing cluster to the right of PM/Dev Lead (x=1000-1300, y=50/250/400) so the graph stays readable. Each role also gets a system-prompt.md under its files_dir with responsibilities, team interfaces, conventions, and self-review gates (molecule-skill-llm-judge or molecule-hitl depending on risk). Per CEO directive 2026-04-16 ("comprehensive marketing team"). This is PR 1 of 2 — follow-up will add cross-tree A2A conventions and wire DevRel ↔ Backend Engineer / PMM ↔ Competitive Intelligence delegations. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Observed team utilization today: ~0.5% — agents idle 99.5% of the time. Only cron fires and CEO-typed A2A wake them. CEO's north-star is 24/7 iteration, current cadence falls short.
Research baseline
Survey of 8 agent frameworks done this session (Hermes, Letta, Trigger.dev, Inngest, AG2, Rivet, n8n, Composio, SWE-agent). Findings in the conversation record and
docs/ecosystem-watch.md. Nobody runswhile(true)per agent. The working patterns are:The winning unlock for Molecule AI is the Hermes reflection-on-completion pattern combined with the Letta backlog-pull pattern, implemented at the workspace layer so it applies uniformly to all 12 roles without per-workspace YAML changes.
What this PR does
Adds a ~90 LOC workspace-template change:
config.py— two new fields onWorkspaceConfig:idle_prompt: str = ""— prompt to self-send when idleidle_interval_seconds: int = 600— check cadence (default 10 min)idle_prompt_file(same pattern asinitial_prompt)main.py— new_run_idle_loop()asyncio task alongside the existing_send_initial_prompt:min(interval, 60)for server + initial prompt to settlea. Sleep
idle_interval_secondsb. Local check:
if heartbeat.active_tasks > 0: continue(no LLM, no HTTP)c. Self-POST
idle_promptvia existing/workspaces/{id}/a2aproxyfinally:block, matchinginitial_prompt_taskcleanupGated on
config.idle_promptbeing non-empty. Default""means existing workspaces upgrade to this binary as complete no-ops. Zero behavior change until someone explicitly opts in.What this PR does NOT do
org.yamluntouchedidle_prompt:fieldCost model
while(true)sleep-loop pattern: ~$93/day/org (12 agents × 12 thinks/hour × $0.027). Unshippable.active_tasks==0gate.Rollout plan (per research-report recommendation)
activity_logsdelta vs baseline, count idle-loop fires vs skipped, confirm cost stays within modeldefaults: idle_prompt: |block if the measurement looks goodTest plan
Related
### Hermes Agententry