Skip to content

feat(examples): add provider-agnostic Last30Days agent - #4162

Open
bossriceshark wants to merge 1 commit into
block:mainfrom
bossriceshark:feat/examples-last30days-agent
Open

feat(examples): add provider-agnostic Last30Days agent#4162
bossriceshark wants to merge 1 commit into
block:mainfrom
bossriceshark:feat/examples-last30days-agent

Conversation

@bossriceshark

Copy link
Copy Markdown

Summary

Adds an examples-only reference agent that implements /last30days <topic> through the existing ACP slash pass-through from #919 — no core, relay, or Desktop changes.

The example runs 10 independent analysis workers plus one synthesis call against any OpenAI-compatible endpoint, then publishes one sourced brief back to the originating thread. It follows the focused-reference style of examples/countdown-bot (#516) and the persona-pack layout of examples/meadow-core.

Closes the proposal in #4158.

Why this shape

Provider-agnostic by design

Setting Default Notes
OPENAI_API_KEY (required) Adopter-supplied. Read from the process environment only — no .env discovery, no bundled credentials.
OPENAI_BASE_URL https://openrouter.ai/api/v1 Any OpenAI-compatible base. Changing this sends your key to that host — documented as an explicit trust decision.
model deepseek/deepseek-v4-pro Documented working default; any model slug works.
workers 10 Under --enforce-gates, min-success always equals the worker count.

Safety properties

  • No shell execution. The optional evidence hook takes a JSON argv array, runs with shell=False, and treats the topic as one opaque argv element. Shell-string templates are rejected, as are shell-interpreter -c templates containing placeholders.
  • Opaque topic I/O via --topic-stdin / --topic-file; no documented invocation interpolates a topic into a shell line.
  • Abuse and cost gates on by default under --enforce-gates: event-id idempotency, per-requester cooldown and daily quota, global daily spend ceiling with per-run reservation, and a concurrency cap. Gate state is a single file written with temp + fsync + atomic os.replace under a lock, and fails closed on unparseable state.
  • Secret hygiene: metadata-only receipts (no topic, brief text, absolute paths, or requester identity), sanitized public errors with secret and filesystem-path redaction, and private artifacts (0700/0600).

Testing

PYTHONDONTWRITEBYTECODE=1 python3 -B examples/last30days-agent/scripts/test_last30days.py
# 68 passed

Offline and fully mocked — no network, no provider calls, no credentials required. Coverage includes injection regressions (malicious topics stay inert; shell templates rejected), gate transactionality (torn state fails closed, replace-failure preserves prior state), min-success enforcement, and redaction.

Manual test steps are in examples/last30days-agent/README.md (quickstart, config table, security notes).

Known follow-ups

  • Evidence gathering is intentionally pluggable; no gatherer ships by default, so the example runs topic-only unless one is configured.
  • Gate state is single-node (file-locked); a multi-host deployment would want shared storage.

Add an examples-only reference agent that advertises /last30days through
the existing ACP slash pass-through (block#919): 10 independent analysis
workers plus one synthesis call against any OpenAI-compatible endpoint,
with adopter-owned credentials, content-only success gating, sanitized
public errors, private artifacts, and cooldown/quota/spend gates on by
default.

Relates to block#4158

Signed-off-by: bossriceshark <194162663+bossriceshark@users.noreply.github.com>
@bossriceshark
bossriceshark requested a review from a team as a code owner August 1, 2026 19:25
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