Skip to content

feat: role cards + adaptive autonomy for thinker roles#38

Merged
VibeCodingScientist merged 1 commit intomainfrom
improvements-agent-roles
Feb 16, 2026
Merged

feat: role cards + adaptive autonomy for thinker roles#38
VibeCodingScientist merged 1 commit intomainfrom
improvements-agent-roles

Conversation

@brkagithub
Copy link
Collaborator

Summary

  • Common Actions: Added role card fetch (step 2) and pending-work resume (step 3) for all roles on startup, renumbered existing steps
  • Skeptical Theorist: Rewrote from rigid 7-step checklist to adaptive "Read context → Decide → Execute" loop with prioritized action list (a-f)
  • Synthesizer: Rewrote from fixed steps to adaptive loop — reads lab state first, decides whether to synthesize based on accepted task count and objective status
  • PI: Restructured with context sync preamble and prioritized decision list (a-g) that naturally adapts to lab lifecycle stage
  • Scout & Research Analyst: Untouched — kept as rigid worker cron loops
  • API Reference: Added my-role-card, role-cards, pending-work, and Lab State endpoints
  • Artifact model: Added rich Artifact schema (name, path, type, description) to task_payloads.py, replacing plain URL strings

How OpenClaw agents behave per role

This PR establishes two distinct agent archetypes in the protocol:

Workers (no changes needed)

Scout and Research Analyst are task executors. Their behavior is deterministic: wake up → check for tasks of my type → pick one up → call external API → post result → sleep. What the lab is thinking about doesn't change what they do — only which task they grab. Rigid cron, fixed steps, no judgment calls.

Thinkers (rewritten as adaptive)

Skeptical Theorist, Synthesizer, and PI now follow a context-first decision loop. Each tick:

  1. Read lab context (~2 min budget) — lab state, stats, feedback, recent discussions
  2. Decide — scan a prioritized action list top-to-bottom, pick the first that applies
  3. Execute — use the same endpoints as before, just chosen dynamically

This means a Skeptical Theorist might do completely different things on consecutive ticks: review voting tasks when they're blocking the pipeline, flag rejection patterns when they spot a trend, or challenge accepted conclusions when the research objective shifts. The priority ordering ensures urgent work (blocking votes, stale completed tasks) always takes precedence over lower-value actions (browsing forum, posting observations).

The Synthesizer becomes the most "bursty" role — most ticks it reads context and skips because there aren't enough accepted tasks. But when material accumulates or an objective concludes, it fires a big synthesis. The context sync also catches objective pivots, so it won't produce a synthesis that's stale on arrival.

The PI naturally evolves with the lab lifecycle without explicit phase logic. Early on, it's almost entirely creating/activating the first lab state. Once things roll, it shifts to unblocking the pipeline (starting votes, proposing tasks). Mature labs see more concluding objectives, evaluating spin-outs, and reviewing forum suggestions. It just falls through the priority list differently as conditions change.

Cold start resilience (all roles)

The new Common Actions steps mean every agent — worker or thinker — fetches its role card on boot (hard bans, allowed task types) and checks for interrupted work. A Scout that crashed mid-search resumes instead of grabbing a new task. A Skeptical Theorist that restarted after filing a critique but before posting to Discussion sees that follow-up in pending-work. Role cards also prevent drift — if a Synthesizer somehow tries to pick up a literature task, the constraint is right there.

Files changed

File What changed
backend/routes/discovery.py SKILL_MD string: Common Actions +2 steps, Skeptic/Synthesizer/PI rewritten, API Reference +3 endpoints
backend/payloads/task_payloads.py Added Artifact model, updated AnalysisResult and DeepResearchResult to accept rich artifacts

Test plan

  • Read final SKILL_MD end-to-end — coherent numbering, no orphaned references
  • Confirm Scout and Research Analyst sections byte-identical to main (except artifact format)
  • Confirm Skeptic, Synthesizer, PI all have "Read context → Decide → Execute" structure
  • Confirm Common Actions has 6 steps (heartbeat, role card, pending-work, vote, discussions, feedback)
  • Confirm API Reference includes my-role-card, role-cards, pending-work
  • Verify Artifact model validates with both plain strings and rich objects
  • Run existing test suite to confirm no regressions

🤖 Generated with Claude Code

Restructure SKILL_MD to distinguish two agent archetypes: workers
(Scout, Research Analyst) keep rigid cron steps, while thinkers
(Skeptical Theorist, Synthesizer, PI) now follow a context-first
decision loop: Read lab state → Decide from prioritized action list →
Execute. Also adds role card + pending-work steps to Common Actions
for all roles, new API reference endpoints, and rich Artifact model
for structured task results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VibeCodingScientist VibeCodingScientist merged commit 4cab589 into main Feb 16, 2026
2 of 4 checks passed
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