Skip to content

feat: Agents Behavior Comparison page (/compare)#94

Open
kylefu8 wants to merge 2 commits intogrp06:mainfrom
kylefu8:main
Open

feat: Agents Behavior Comparison page (/compare)#94
kylefu8 wants to merge 2 commits intogrp06:mainfrom
kylefu8:main

Conversation

@kylefu8
Copy link

@kylefu8 kylefu8 commented Mar 14, 2026

Summary

Adds a new /compare page that lets users view and edit agent behavior files side-by-side across all configured agents.

Features

  • Side-by-side comparison of SOUL.md (Persona), AGENTS.md (Directives), USER.md (Context), and IDENTITY.md (Identity) for all agents
  • Multi-select agent filter — pill-style toggle buttons to show/hide specific agents
  • Collapsible rows — click the chevron to collapse any file section; shows a "collapsed" indicator
  • Independent row height control+/ buttons per row; adjusting one row does not affect others (uses independent flex containers instead of table/grid layout)
  • Inline editing with dirty tracking — modified cells get a yellow highlight, "unsaved" label, and a Save button that writes back via writeDomainAgentFile
  • Synchronized scrolling — scrolling one agent's textarea in a row syncs all other agents in the same row
  • Alternating row backgrounds for visual clarity
  • Custom default heights — Persona (400px), Directives (500px), others (208px)

UI Changes

  • HeaderBar: Added a compare button (GitCompareArrows icon) between ThemeToggle and the connection plug icon for quick access to /compare

Other

  • Added upgrade.sh convenience script (git pull + npm install + build)
  • Updated .gitignore for runtime log files

Screenshots

Page shows a horizontal layout with agent columns and file rows. Each cell contains an editable textarea.

- 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
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +92 to +94
if (response.error) {
throw new Error(response.error);
}

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +291 to +293
await writeDomainAgentFile({ agentId, name: fileName, content });
setDirtyKeys((prev) => { const next = new Set(prev); next.delete(k); return next; });
} catch (err) {

Choose a reason for hiding this comment

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

P1 Badge 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>
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.

1 participant