feat: Agents Behavior Comparison page (/compare)#94
feat: Agents Behavior Comparison page (/compare)#94kylefu8 wants to merge 2 commits intogrp06:mainfrom
Conversation
- New /compare page for side-by-side comparison of agent behavior files (SOUL.md, AGENTS.md, USER.md, IDENTITY.md) across all configured agents - Multi-select agent filter with pill-style toggle buttons - Collapsible rows with 'collapsed' indicator text - Per-row height adjustment (+/- buttons, independent per row) - Editable textareas with dirty tracking, yellow highlight, and per-cell Save - Synchronized scrolling across agent columns within the same row - Alternating row backgrounds for visual separation - Custom default heights: Persona (400px), Directives (500px) - HeaderBar: added compare button (GitCompareArrows icon) for quick navigation - Added upgrade.sh convenience script for pull+build - Updated .gitignore for runtime log files
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e5e20d1ba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/app/compare/page.tsx
Outdated
| if (response.error) { | ||
| throw new Error(response.error); | ||
| } |
There was a problem hiding this comment.
Don't abort when fleet returns degraded data
The fleet API can return usable result data together with an error in degraded mode (see buildDegradedFleetResponse in src/app/api/runtime/fleet/route.ts), but this check throws immediately whenever response.error is set. In those degraded scenarios (e.g., temporary gateway/scope issues), /compare fails hard instead of rendering available agent seeds, even though the endpoint returned fallback data; this should only throw when result.seeds is missing.
Useful? React with 👍 / 👎.
src/app/compare/page.tsx
Outdated
| await writeDomainAgentFile({ agentId, name: fileName, content }); | ||
| setDirtyKeys((prev) => { const next = new Set(prev); next.delete(k); return next; }); | ||
| } catch (err) { |
There was a problem hiding this comment.
Keep dirty state when new edits happen during save
This unconditionally clears the dirty flag as soon as the save request resolves, even if the user typed additional changes while the request was in flight. In that common race (Save clicked, then more typing before response), the cell can become clean in UI while containing unsaved content, which hides the unsaved indicator and Save button for those newer edits.
Useful? React with 👍 / 👎.
- Handle fleet API degraded mode: no longer throw when response contains both error and usable result.seeds (P2) - Fix save race condition: snapshot content before save and re-check after completion to preserve dirty state for edits made during in-flight save requests (P1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Adds a new /compare page that lets users view and edit agent behavior files side-by-side across all configured agents.
Features
+/−buttons per row; adjusting one row does not affect others (uses independent flex containers instead of table/grid layout)writeDomainAgentFileUI Changes
/compareOther
upgrade.shconvenience script (git pull + npm install + build).gitignorefor runtime log filesScreenshots
Page shows a horizontal layout with agent columns and file rows. Each cell contains an editable textarea.