Effort
| Delivery boundary |
P50 |
P90 |
Substantive files |
| Disable Agent Org history mutation in UI and fail closed at the backend truncate boundary |
180 review lines |
350 review lines |
3–6 |
Description
Agent Org sessions currently expose the ordinary Session Edit/Resend and Restore checkpoint actions. Those actions assume a linear single-agent transcript, but an Agent Org turn may already have produced durable state across Coordinator/Member sessions, TaskGraph, Inbox, materialization receipts, file history, and Team lifecycle.
A packaged-build reproduction after a Team entered Idle showed that the generic edit-resend path destructively truncates history before the backend discovers that the Agent Org lifecycle does not permit the replacement turn.
Product decision: Agent Org sessions do not support editing/resending historical messages or restoring historical checkpoints. Users should create a new Team Session to rerun modified instructions.
Steps to Reproduce
- Create and run an Agent Org Team Session.
- Let the Team finish and enter Idle.
- Edit the original user message.
- Submit Resend.
- Reopen or refresh the Session.
Expected Behavior
Agent Org Coordinator and Member sessions do not expose Edit/Resend or Restore checkpoint.
A stale frontend or direct IPC call to the transcript truncation boundary fails before changing transcript/events, files, snapshots, TaskGraph, Inbox, plan approvals, run state, Session state, or timestamps.
Ordinary Rust SDE and CLI Sessions retain their existing edit/resend and restore behavior.
Actual Behavior
The frontend currently performs this sequence:
- Cancels the turn boundary.
- Truncates visible and persisted history and may rewind files.
- Attempts to submit the edited replacement message.
- The backend correctly rejects the new turn with:
team_idle: Agent Org run ... has no formal activation for a new turn
- The truncation is not rolled back, so the old transcript tail is gone while the replacement turn never starts.
Observed logs:
[SessionService] Failed to send message ... team_idle: Agent Org run ... has no formal activation for a new turn
[useEditUserMessage] edit truncate/resubmit failed
Environment
- OS: macOS
- App version / commit: packaged build:fast from the PR1 + PR2 stacked worktree
- Feature gate: ORGII_AGENT_ORG_REDESIGN=1
- Agent type: Agent Org Coordinator backed by rust_agent
Scope
- Hide or disable Edit/Resend for Agent Org Coordinator and Member sessions.
- Hide or disable Restore checkpoint for Agent Org Coordinator and Member sessions.
- Add a backend fail-closed guard at the transcript truncation boundary.
- Resolve Agent Org identity from persisted canonical state so the guard survives restart and does not depend only on an in-memory runtime.
- Reject before cancelling turns, invalidating scheduler state, truncating events/messages/snapshots, deleting plan approvals, or reverting files.
- Preserve ordinary Rust SDE and CLI Session behavior.
Out of scope:
- Team rewind, replay, or reactivation.
- activation_generation changes.
- Agent Org lifecycle, immutable launch snapshot, TaskGraph, Inbox, materialization, RPC/wire, or definition changes.
Acceptance Criteria
- Agent Org messages expose neither Edit/Resend nor Restore checkpoint.
- Direct backend truncate calls for every canonical Agent Org participant fail with a stable diagnostic.
- Rejection leaves transcript/events, files, snapshots, TaskGraph, Inbox, plan approvals, run status/generation, Session status, and timestamps unchanged.
- The guard works after app restart using persisted Agent Org identity.
- Ordinary Rust SDE and CLI edit/resend and checkpoint restore continue to work.
- Frontend tests cover action visibility for ordinary and Agent Org sessions.
- Backend tests prove rejection occurs before every destructive side effect.
- Packaged regression confirms an Idle Team cannot be damaged by stale/direct invocation.
Relevant Code
- src/engines/ChatPanel/ChatHistory/hooks/useEditUserMessage.ts
- src/engines/ChatPanel/ChatHistory/hooks/useRestoreCheckpoint.ts
- src/engines/ChatPanel/ChatItems/UserChatItem.tsx
- src-tauri/crates/agent-core/src/state/commands/session/persistence.rs
Effort
Description
Agent Org sessions currently expose the ordinary Session Edit/Resend and Restore checkpoint actions. Those actions assume a linear single-agent transcript, but an Agent Org turn may already have produced durable state across Coordinator/Member sessions, TaskGraph, Inbox, materialization receipts, file history, and Team lifecycle.
A packaged-build reproduction after a Team entered Idle showed that the generic edit-resend path destructively truncates history before the backend discovers that the Agent Org lifecycle does not permit the replacement turn.
Product decision: Agent Org sessions do not support editing/resending historical messages or restoring historical checkpoints. Users should create a new Team Session to rerun modified instructions.
Steps to Reproduce
Expected Behavior
Agent Org Coordinator and Member sessions do not expose Edit/Resend or Restore checkpoint.
A stale frontend or direct IPC call to the transcript truncation boundary fails before changing transcript/events, files, snapshots, TaskGraph, Inbox, plan approvals, run state, Session state, or timestamps.
Ordinary Rust SDE and CLI Sessions retain their existing edit/resend and restore behavior.
Actual Behavior
The frontend currently performs this sequence:
team_idle: Agent Org run ... has no formal activation for a new turn
Observed logs:
Environment
Scope
Out of scope:
Acceptance Criteria
Relevant Code