Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an ActiveWorkStore and a corresponding UI active work strip to provide real-time visibility into background jobs and missions. It includes integration with SSE for status updates, tab badges for active task counts, and logic to hide legacy Routines in favor of Missions when Engine V2 is active. Review feedback suggests refining the activity bar's visibility logic, fixing indentation, localizing hardcoded strings, adopting more robust state management for thread status, and optimizing the polling mechanism for mission progress.
There was a problem hiding this comment.
Pull request overview
This PR refines the web “activity shell” when engine v2 is enabled by adding a persistent jobs/missions activity strip, tab badges for active work, and mission progress derived from live thread activity, plus targeted Playwright coverage for the new shell behavior.
Changes:
- Expose
engine_v2in/api/gateway/statusand use it in the frontend to hide the legacy Routines tab in v2. - Add a persistent “active work strip” (jobs + missions) with tab count badges and mission/thread progress rendering.
- Add focused Playwright e2e coverage for the v2 shell (routines hidden; activity strip persists across tab switches).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/scenarios/test_v2_activity_shell.py | Adds Playwright coverage for v2 shell behavior (routines hidden, strip persists). |
| src/channels/web/server.rs | Adds engine_v2 boolean to gateway status response for frontend gating. |
| crates/ironclaw_gateway/static/style.css | Styles tab badges, the active work strip, and mission progress states. |
| crates/ironclaw_gateway/static/index.html | Adds active work strip container and a Missions “Progress” column header. |
| crates/ironclaw_gateway/static/app.js | Implements v2-aware shell logic: tab normalization/hiding, persistent strip store, mission progress hydration and refresh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff6fe39cc6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the current web-shell review feedback in Resolved in this follow-up:
I left the current 5s active-mission polling interval in place for now. The correctness issues around stale mappings / reschedule churn are fixed, but the broader polling-vs-push tradeoff still depends on adding better mission/thread linkage from the backend. |
serrrfirat
left a comment
There was a problem hiding this comment.
Reviewed as paranoid architect. XSS protection is solid throughout — all innerHTML paths use escapeHtml or DOMPurify. Backend change is minimal (one bool field). Minor suggestions: truncate job_message content before storing in statusText, add eviction to the new Maps, and i18n the hardcoded 'Idle' string. None are blocking. Ship it.
Code reviewNo issues found. The PR refines the v2 web activity shell with new state management classes for tracking jobs and missions. Key observations:
The implementation follows existing code patterns and maintains defensive null-checking throughout. 🤖 Generated with Claude Code |
Additional Review - Architectural PatternsFound some architectural and pattern concerns:
None of these block the PR, but they are architectural debts to consider in follow-ups. |
Performance & Production IssuesFound several performance and memory concerns that should be addressed: Critical Issues[HIGH:HIGH] Timer closure captures stale mission IDs In Recommendation: Capture a snapshot of mission IDs in the timer callback itself, or use a volatile set that's re-queried at timer fire time. [HIGH:MEDIUM] Unbounded cache growth in missionDetailCache
Recommendation: Implement an LRU eviction policy or cap cache size at ~100-200 entries. Performance Issues[MEDIUM:HIGH] DOM querySelectorAll in hot path without batching
Recommendation: Batch DOM updates or use targeted class toggling instead of full innerHTML replacement. [MEDIUM:MEDIUM] Activity bar recreates entire DOM tree on any mission update
Recommendation: Use DOM diffing or maintain button nodes and update their content/classes instead. [MEDIUM:MEDIUM] Mission refresh cascade from SSE events Each SSE event (thinking, tool_started, etc.) triggers Recommendation: Use a debounced refresh with a longer idle period before triggering fetches. Test CoverageThe E2E test doesn't validate:
Recommendation: Add scenario tests for session memory growth and concurrent event handling. Summary: Issues #1 and #2 should block merge (memory leak + missed mission tracking). Issues #3-5 are performance optimizations that improve UX but don't break functionality. |
Security ReviewNo critical security vulnerabilities found. The implementation properly handles untrusted data. Key Security Findings✅ Proper XSS prevention: All untrusted SSE event data ( ✅ Safe i18n substitution: Parameter substitution in i18n strings is escaped before rendering. ✅ HTML rendering patterns: Functions like Minor Recommendation[MEDIUM:LOW] Input validation at store level The Recommendation: Add light validation at
Summary: Security posture is solid. This is a low-priority hardening improvement. |
Summary
Testing
Notes