Skip to content

v0.26.0 — DM-safe action passthrough + COLONY_HEALTH_HISTORY#10

Merged
jackparnell merged 1 commit into
mainfrom
v0.26-dm-data-passthrough-and-history
Apr 19, 2026
Merged

v0.26.0 — DM-safe action passthrough + COLONY_HEALTH_HISTORY#10
jackparnell merged 1 commit into
mainfrom
v0.26-dm-data-passthrough-and-history

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Scope

Two changes, both motivated by live-testing v0.25's `COLONY_HEALTH_REPORT` by DM'ing `@eliza-gemma` with "are you healthy?" and observing the report never reach the reply.

1. Fixed: DM_SAFE_ACTIONS output now passes through the action-meta filter

The v0.19 dispatch filter was designed to drop action-meta callbacks (error-path fallbacks like "I need a postId…") so they don't get posted as real Colony content. Correct for mutating actions. Wrong for read-only, data-producing actions like `COLONY_HEALTH_REPORT`, `COLONY_STATUS`, `LIST_COLONY_AGENTS` where the output is the reply content.

The discovery path was clean: eliza's engagement loop on v0.25.0 fired `COLONY_HEALTH_REPORT` correctly (log showed `COLONY_HEALTH_REPORT: produced 4-line report for @eliza-gemma`), but the dispatch callback dropped the output because `response.action` was a registered Colony action name. Her reply to the DM became "Trying again. If the action fails this time, it's likely a plugin-level issue…" — she could tell something was wrong but couldn't surface the actual report.

Fix: both `dispatchPostMention` and `dispatchDirectMessage` now check `DM_SAFE_ACTIONS` before applying the meta filter. Allowlisted actions pass through; mutating-action meta still drops (v0.19 behaviour preserved for everything except the 11 allowlisted actions).

Two new tests on `dispatch.test.ts` pin the fix + guard against regression on the preserved v0.19 behaviour.

2. Added: COLONY_HEALTH_HISTORY action

Rolling-log companion to v0.25's health-report. Snapshot → trend.

  • Ring of last 50 health snapshots, capped to prevent unbounded growth.
  • Populated lazily by `service.takeHealthSnapshot()` from the health-report handler — the ring grows whenever someone queries health, which is when the trend is useful. No new timer.
  • Output: last N snapshots with timestamp, LLM success rate, pause state, retry-queue size, digest count.
  • Optional `limit` option, clamped `[1, 50]`, default 10.
  • DM-safe (listed in `DM_SAFE_ACTIONS`), so another agent can DM `@eliza-gemma` asking "show me your health history" and get a useful answer back.

Tests

1623 / 54 files. 100% stmt/line/func, 98.08% branch. New file `v26-features.test.ts` (31 tests):

  • `takeHealthSnapshot`: field capture (llmSuccessPct null/populated, window pruning, paused+reason, retryQueueSize null/populated, digestsEmitted), ring pruning to 50, error-swallow on broken retry-queue accessor.
  • `COLONY_HEALTH_HISTORY` validator: DM-safe (accepts with DM origin), membership in DM_SAFE_ACTIONS, keyword variants, 'health' requirement, missing-text fallback, regex-vs-keyword short-circuit.
  • `COLONY_HEALTH_HISTORY` handler: empty ring, formatted output, idle snapshot ("LLM idle"), pause surfacing, pauseReason-null fallback, limit clamping, handle fallback, non-finite limit, missing-healthSnapshots fallback.
  • `COLONY_HEALTH_REPORT`: diversity-threshold fallback to 0.8 when config doesn't set it.

Plus 4 tests added to `dispatch.test.ts` pinning the passthrough behaviour (DM_SAFE_ACTIONS output passes on DM callback + post-mention callback, non-allowlisted meta still drops on both paths).

Deploy

Merge → tag `v0.26.0` → bump eliza-gemma when ready.

🤖 Generated with Claude Code

Fixed: v0.19 dispatch-filter + v0.21 DM_SAFE_ACTIONS interaction was
dropping legitimate output from read-only DM-safe actions. Discovered
by DM'ing @eliza-gemma with "are you healthy?" on v0.25.0 — her
COLONY_HEALTH_REPORT action fired, produced the report, but the
dispatch filter dropped the callback output because response.action
was a registered Colony action name. v0.19 filter's original intent
(drop "I need a postId…" meta text from mutating-action error paths)
was correct but too broad: read-only actions produce actual data, and
DMing-an-agent-to-ask-it-something is a core v0.21+ use case.

Fix: both dispatchPostMention and dispatchDirectMessage now check
DM_SAFE_ACTIONS before filtering. Allowlisted actions pass through;
mutating-action meta drops unchanged.

Added: COLONY_HEALTH_HISTORY rolling-log action. Snapshot companion
to v0.25's health-report. Ring capped at 50 entries, populated
lazily by service.takeHealthSnapshot() from the health-report
handler (no new timer). Output: last N snapshots with timestamp,
LLM success rate, pause state, retry queue, digest count.
DM-safe.

Tests: 1623 / 54 files. 100/100/100 stmt/line/func, 98.08% branch.
New file v26-features.test.ts (31 tests) + 4 added to dispatch.test.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jackparnell jackparnell merged commit 99b08e2 into main Apr 19, 2026
2 checks passed
@jackparnell jackparnell deleted the v0.26-dm-data-passthrough-and-history branch April 19, 2026 12:48
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.

2 participants