Skip to content

feat(agent-session): ✨ Add queue promote and edit actions#213

Merged
jorben merged 2 commits into
masterfrom
feat/queue-transfer-support
May 27, 2026
Merged

feat(agent-session): ✨ Add queue promote and edit actions#213
jorben merged 2 commits into
masterfrom
feat/queue-transfer-support

Conversation

@HayWolf
Copy link
Copy Markdown
Contributor

@HayWolf HayWolf commented May 27, 2026

Summary

  • Add support for promoting pending Queue follow-up messages to Steer using tiycore 0.2.9-rc.0.
  • Add pending Queue/Steer edit actions that remove the queued item and restore the original composer text and file references.
  • Update runtime queue UI, bridge APIs, i18n labels, and regression tests for promote/edit behavior.

Test Plan

  • npm run typecheck
  • npm run test:unit
  • cargo fmt --check --manifest-path src-tauri/Cargo.toml
  • cargo test --locked --manifest-path src-tauri/Cargo.toml

🤖 Generated with TiyCode

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

AI Code Review Summary

PR: #213 (feat(agent-session): ✨ Add queue promote and edit actions)
Preferred language: English

Overall Assessment

Detected 1 actionable findings, prioritize CRITICAL/HIGH before merge.

Major Findings by Severity

  • MEDIUM (1)
    • src-tauri/src/core/agent_session.rs - Queue stats fetched after lock to avoid deadlock, but still held across tiycore call

Actionable Suggestions

  • Drop runtime_queue_state lock before calling try_promote_follow_up_to_steering to reduce contention.
  • Verify cleanup logic handles partial failures when tiycore call modifies state before error.
  • Add setComposerValue(displayText) in restoreRuntimeQueueMessageToComposer to sync the composer text state.

Potential Risks

  • Pre-release tiycore dependency may contain unstable APIs or bugs.
  • Lock held across external call could lead to contention under concurrent load.
  • Restored queue message text may not appear in composer due to missing state update.

Test Suggestions

  • Add concurrency tests for promote alongside enqueue, cancel, remove, and clear operations.
  • Test promote error paths to ensure pending_promoted_message_ids and message state are properly cleaned up.
  • Add an integration test for restoring a queued message and verifying the composer displays the text.
  • Consider testing the promote/edit flow end‑to‑end including the effect on the draft store.

File-Level Coverage Notes

  • src-tauri/src/core/agent_session.rs: ok (New functions and event handling are well-structured with proper error handling and comments. Existing tests cover core scenarios.)
  • src-tauri/src/core/agent_session_types.rs: ok (Added Transferred variant to RuntimeQueueEventAction; no issues.)
  • src-tauri/src/core/agent_run_manager.rs: ok (Simple delegation to runtime; inactive thread check included.)
  • src-tauri/src/core/built_in_agent_runtime.rs: ok (New method follows existing patterns; session lookup and delegation correct.)
  • src-tauri/src/core/agent_session_tests.rs: ok (New tests cover transfer event, removal protection for pending promotes, and full promote flow. Good coverage.)
  • src-tauri/src/commands/agent.rs: ok (New command follows existing patterns; no issues.)
  • src-tauri/src/lib.rs: ok (New command registered correctly.)
  • src-tauri/Cargo.toml: ok (Upgrade to tiycore 0.2.9-rc.0 to access PromoteError and related APIs. Confirm final release version before merging.)
  • src/modules/workbench-shell/ui/runtime-thread-surface.tsx: added promote/edit actions and composer restore logic; possible missing text state update noted
  • src/modules/workbench-shell/ui/runtime-queue-timeline.tsx: clean addition of promote/edit actions with proper affordances and accessibility
  • src/modules/workbench-shell/ui/runtime-queue-timeline.test.tsx: good test coverage for new queue message card interactions
  • src/modules/workbench-shell/ui/runtime-thread-surface-metadata.ts: safe refactoring and addition of referencedFiles parsing; no behavioral regression
  • src/modules/workbench-shell/ui/runtime-thread-surface-metadata.test.ts: adequate unit test for new parser
  • src/modules/workbench-shell/ui/workbench-prompt-composer.tsx: restoreSignal effect added correctly; dependency on parent text state is an integration concern
  • src/i18n/locales/en.ts: translation strings added, no risk
  • src/i18n/locales/zh-CN.ts: translation strings added, no risk
  • src/services/bridge/agent-commands.ts: ok
  • src/services/bridge/agent-commands.test.ts: ok
  • src/services/thread-stream/thread-stream.ts: ok
  • src/services/thread-stream/thread-stream.test.ts: ok
  • ... and 1 more file-level entries.

Inline Downgraded Items (processed but not inline)

  • src-tauri/src/core/agent_session.rs: Queue stats fetched after lock to avoid deadlock, but still held across tiycore call (line_missing_or_invalid)

Coverage Status

  • Target files: 21
  • Covered files: 21
  • Uncovered files: 0
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • None

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 3
  • Executed batches: 3
  • Sub-agent runs: 3
  • Planner calls: 1
  • Reviewer calls: 3
  • Model calls: 4/64
  • Structured-output summary-only degradation: NO

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 4
  • Findings with unknown confidence: 0
  • Inline comments attempted: 4
  • Target files: 19
  • Covered files: 19
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

Comment thread src-tauri/src/core/agent_session.rs Outdated
}
}
}
while marked < *count {

This comment was marked as outdated.

Comment thread src-tauri/src/lib.rs
commands::agent::thread_enqueue_queue_message,
commands::agent::thread_clear_runtime_queue,
commands::agent::thread_cancel_runtime_queue_message,
commands::agent::thread_promote_runtime_queue_message,

This comment was marked as outdated.

}));
}

export async function threadPromoteRuntimeQueueMessage(

This comment was marked as outdated.

}
}

async promoteRuntimeQueueMessage(

This comment was marked as outdated.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 1
  • Findings with unknown confidence: 0
  • Inline comments attempted: 1
  • Target files: 21
  • Covered files: 21
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

Comment thread src-tauri/Cargo.toml
@@ -54,7 +54,7 @@ keepawake = "0.6"
portable-pty = "0.9"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed for this PR diff. No concrete inline issue was selected after aggregation.

@jorben jorben merged commit ae25365 into master May 27, 2026
4 checks passed
@jorben jorben deleted the feat/queue-transfer-support branch May 27, 2026 17: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.

2 participants