refactor: Refactor core agent flow, tighten messaging delivery, and add QA coverage#3
Merged
Fullstop000 merged 17 commits intomainfrom Mar 22, 2026
Merged
Conversation
Move all cases from QA_CASES.md into qa/cases/ with one file per domain: - cases/agents.md — agent creation, lifecycle, profile, activity, navigation, workspace, recovery - cases/channels.md — channel create, validation, membership, delete - cases/messaging.md — channel fan-out, DMs, threads, history, attachments, error recovery - cases/tasks.md — task board create/advance and composer integration QA_CASES.md becomes a lightweight index: preconditions, result definitions, module table, and maintenance notes only.
…ements Codex driver: - rewrite system prompt to match Claude prompt structure (identity, tool list, startup sequence, messaging, tasks, memory sections) - add view_file (mcp_chat_view_file) to tool list - clarify block=false receive-only startup; no indefinite blocking - add formatting rules: no HTML, no backtick-wrapped mentions/channels Claude driver prompt: - add view_file as tool #11 in the tool list - improve startup sequence: explicit block=true idle loop, block=false mid-task check, never block while work is in progress - add attachments section with view_file usage guidance - add backtick mention formatting rule Models: - add suppress_agent_delivery flag on send request for human-only side effects (e.g. send + create task without triggering agent replies) Store: - expose data_dir() and attachments_dir() helpers on Store Tests: - extend server_tests.rs and add driver_tests.rs coverage Docs: - update AGENTS.md: generalize branch prefix to {agent}/, trim redundant multi-agent setup bullet (now in QA_CASES.md) - update qa/README.md and QA_REPORT_TEMPLATE.md - add qa/BUG_FIX_REPORT_TEMPLATE.md Misc: - gitignore _prompts/ and ui/tsconfig.tsbuildinfo
messaging.md: - MSG-002: expand DM round-trip with token-based verification, target switching check, and stronger failure signals - MSG-004 (new): DM wake and reply visibility — verifies a sleeping agent can wake from a DM and render the reply back into the correct timeline agents.md: - ACT-001: expand activity checks with per-row field verification (sender, target, preview) and refresh stability - ACT-002 (new): activity timeline ordering during wake and recovery — verifies correct sequencing of wake-up flow tied to MSG-004 misc: QA_CASES.md module index, QA_REPORT_TEMPLATE, README updates, handlers.rs formatting
Merged
7 tasks
Fullstop000
added a commit
that referenced
this pull request
Apr 27, 2026
…an label test - templates.rs: pass human.id and result.id instead of human.name/result.name to join_channel (Copilot review comments #2, #3) - store_tests: add UUID-id human join assertion verifying label resolution (Copilot review comment #1) - agents.rs auto-join path already fixed in prior refactor commit 9e10c5c (Copilot review comment #4)
Fullstop000
added a commit
that referenced
this pull request
Apr 27, 2026
…an label test - templates.rs: pass human.id and result.id instead of human.name/result.name to join_channel (Copilot review comments #2, #3) - store_tests: add UUID-id human join assertion verifying label resolution (Copilot review comment #1) - agents.rs auto-join path already fixed in prior refactor commit 9e10c5c (Copilot review comment #4)
Fullstop000
added a commit
that referenced
this pull request
Apr 28, 2026
…ng (#116) * feat: system message when member joins a channel (#114) When a member joins a channel via API handlers (creation, invite, team assignment), post a server-authored system message into the channel so the join is visible in chat history. Backend: - Added Store::resolve_member_label_tx to resolve human-readable labels (display_name for agents, name for humans) - Added join_channel_by_id_with_system_message and join_channel_with_system_message: atomically insert membership row and create a system message, then emit both member_joined and message.created stream events. Idempotent — returns false and skips the system message when the member is already present. - Updated all runtime API handlers to use the new methods: handle_create_channel, handle_invite_channel_member, handle_create_agent, handle_create_team, handle_add_team_member, handle_launch_trio Tests: - Added test_join_channel_with_system_message_creates_notice_and_is_idempotent verifying human join, agent join with 'Agent' prefix, and idempotency * fix: ensure system message on agent creation by moving auto-join out of inner helper The function was directly inserting into for the #all channel. This meant that when later called for auto-join channels, the INSERT OR IGNORE returned rows=0 (already a member), so no system message was ever created. Fix: remove the channel_members INSERT from and have / call instead. The connection lock is dropped first to avoid deadlock with the method's own lock acquisition. QA verified: creating an agent now shows 'Agent <name> joined #all' in chat. * refactor: eliminate join_channel duplication, promote system-message variants to canonical API The old and duplicated the INSERT logic and were only used by tests. The variants were the actual production API but had verbose names. Changes: - Removed old silent / from public API - Renamed → - Renamed → - delegates to after name resolution, eliminating duplication - Added / for unit tests - Added for integration tests - Updated all test files to use silent helpers where they assert on message counts - Fixed test data bugs where was passed by name instead of ID * fix(copilot-review): use stable IDs in template handler, add UUID human label test - templates.rs: pass human.id and result.id instead of human.name/result.name to join_channel (Copilot review comments #2, #3) - store_tests: add UUID-id human join assertion verifying label resolution (Copilot review comment #1) - agents.rs auto-join path already fixed in prior refactor commit 9e10c5c (Copilot review comment #4) * style: cargo fmt * refactor: unify system-message structured payloads Rename `messages.notice` column to `messages.payload` and migrate task events from JSON-in-content to the same payload column. Two roles, one column: - `content` — always-readable English fallback - `payload` — kind-discriminated JSON (`{kind, audience?, ...}`) Producers: - `member_joined` → payload `{kind, audience: "humans", actor, verb, target}`, content `"alice joined #planning"` - `task_event` → payload (existing camelCase shape) + English sentence in content via new `as_human_sentence()` (no `[task]` prefix) Agent visibility filter is structural — `payload.audience != 'humans'`, not a kind allowlist. Adding new ambient kinds = set audience humans. Adding new operational kinds = omit audience (defaults to all). Honors the project memory rule "no typed event allowlists." Frontend `Notice/NoticeActor/NoticeTarget` interfaces collapse to a loose `MessagePayload` (`{kind, [k]: unknown}`); `SystemNotice` and `parseTaskEvent` narrow at use time. `format_message_for_agent` deleted — agents read `content` raw now that producers always write it. No data migration. Existing dev DBs need to be reset on this branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: bump version and changelog (v0.0.4.0) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: simplify v0.0.4.0 changelog entry Drop implementation detail in favor of two user-facing bullets. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
server/andstore/modules and align repo guidance/docs with the new layoutqa/, expand messaging and activity cases, and add regression tests for delivery/read-path behaviorHighlights
Verification
cargo testcargo buildMSG-003thread participant routingMSG-002Notes
qa/runs/remain gitignored; the trackedqa/docs/templates/cases are part of this PR