Skip to content

feat(inference): opt-in failureNotices — tell the room when a turn produced nothing - #178

Open
ian-de-marcellus wants to merge 1 commit into
anima-research:mainfrom
ian-de-marcellus:feat/failure-notices
Open

ian-de-marcellus wants to merge 1 commit into
anima-research:mainfrom
ian-de-marcellus:feat/failure-notices

Conversation

@ian-de-marcellus

Copy link
Copy Markdown
Contributor

Problem. When a turn fails outright (provider error, refusal, over-budget), the framework records it (stderr, failures.log, an [inference-failed] marker the agent sees next turn), but the people in the room see only silence. They can't tell a dead turn from a quiet agent, so they wait, or resend and pile up more failing turns.

Fix. Opt-in AgentConfig.failureNotices. noteInferenceExhausted and noteRefusal post a one-line automatic notice to the agent's locus: ⚠️ [automatic notice] <agent>'s reply failed to generate: <reason>, with the reason trimmed to one line. It posts on the first failure of a streak and on every 5th after, so a stuck loop can't flood the channel. It's best-effort: an undeliverable notice is logged and dropped.

Tests. test/inference-failure-observability.test.ts: notices post on failures 1 and 5 only, go to the resolved locus, and are absent when the option is off. Full suite: 955 pass / 0 fail.

🤖 Generated with Claude Code

…oduced nothing

The chronicle marker already tells the resident its turn failed; people in the
room saw only silence and couldn't tell a dead turn from a quiet one (Fable:
'silence should mark itself'). With AgentConfig.failureNotices, a short,
clearly automatic notice goes to the agent's speaking room on the first failure
of a streak and every 5th after (so a stuck loop can't flood it), for both
exhausted inference errors and refusals. Default off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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