Skip to content

Improve Gemini project resolution, add hide-unknown filter, fix agent colors#44

Merged
wesm merged 10 commits intomainfrom
more-gemini-issues
Feb 26, 2026
Merged

Improve Gemini project resolution, add hide-unknown filter, fix agent colors#44
wesm merged 10 commits intomainfrom
more-gemini-issues

Conversation

@wesm
Copy link
Copy Markdown
Owner

@wesm wesm commented Feb 25, 2026

Summary

  • Read trustedFolders.json alongside projects.json when building the Gemini hash-to-project map. trustedFolders.json persists longer than projects.json, recovering project names for orphaned SHA-256 hash directories that Gemini CLI has cleaned up.
  • Add exclude_project API filter (project != ? SQL predicate) and a "Hide unknown" toggle in the sidebar filter dropdown, letting users hide sessions with unresolvable project names. Conflicting project=unknown + exclude_project=unknown is prevented centrally in apiParams -- explicit project selection always wins.
  • Fix Gemini/Claude color collision (fixes Claude and Gemini are both blue #42). Both agents used --accent-blue. Gemini now uses --accent-rose (light: #e11d48, dark: #fb7185) for maximum distinction from all other agent colors.
  • Show agent name in session list. Replace the plain dot indicator with a colored dot + agent name label (e.g. "Claude", "Gemini") in the agent's accent color. Width is capped with ellipsis truncation to prevent sidebar squeeze. Also adds missing agent-gemini and agent-opencode badge classes in the breadcrumb.

Test plan

  • Go tests: TestBuildGeminiProjectMapTrustedFolders, TestBuildGeminiProjectMapBothFiles, TestBuildGeminiProjectMapProjectsWin verify trustedFolders.json reading and precedence
  • Go tests: TestSessionFilterExcludeProject covers exclude_project SQL filter (4 cases)
  • Frontend tests: 10 store tests cover API serialization, conflicting filter clearing (toggle, URL params, centralized apiParams guard), hasActiveFilters, and clearSessionFilters
  • Agent color test updated to assert Gemini uses --accent-rose
  • Vite build produces no warnings
  • All existing Go and frontend tests pass

🤖 Generated with Claude Code

wesm and others added 4 commits February 25, 2026 17:30
…roject filter

Gemini CLI's projects.json loses old project mappings over time, leaving
orphan SHA-256 hash directories that resolve to "unknown". This reads
~/.gemini/trustedFolders.json as a supplementary source of project paths,
recovering hash-to-project mappings that projects.json has lost.

Also adds an exclude_project API filter (project != ?) and a "Hide unknown"
toggle in the sidebar filter dropdown, so users with many unresolvable
Gemini sessions can hide them from the session list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clear project filter when it equals "unknown" and hide-unknown is enabled,
preventing the contradictory project=unknown&exclude_project=unknown query.

Add 8 store tests covering: API serialization, conflicting filter clearing,
URL param round-trip, hasActiveFilters, and clearSessionFilters interaction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
initFromParams can receive project=unknown&exclude_project=unknown from URL
params, producing an always-empty query. Apply the same normalization as
setHideUnknownProjectFilter: clear project when it conflicts with hide-unknown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes #42. Claude and Gemini both used --accent-blue, making them
indistinguishable in the sidebar and filter UI. Adds --accent-cyan
(light: #0891b2, dark: #22d3ee) and assigns it to Gemini. Also adds
missing agent-gemini and agent-opencode badge classes in App.svelte.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Feb 25, 2026

roborev: Combined Review (ce1e35e)

Verdict: All reviewers agree the code is clean.

No Medium, High
, or Critical issues were identified across security and functional reviews. The implemented changes—including parameterized SQL filters, local JSON parsing for trustedFolders.json, and UI/state updates—safely handle data and follow established practices.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

The CSS classes were defined but the template lacked the corresponding
class: bindings, causing Svelte unused CSS selector warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesm wesm changed the title Improve Gemini project resolution, add hide-unknown filter Improve Gemini project resolution, add hide-unknown filter, fix agent colors Feb 25, 2026
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Feb 25, 2026

roborev: Combined Review (3da1550)

Verdict: The code changes are secure and introduce no vulnerabilities, but contain a logical flaw where conflicting API parameters can result in impossible database queries.

Medium

Conflicting project and exclude_project can produce an impossible query

  • Files:
    • /home/roborev/.roborev/clones/wesm/agentsview/frontend/src/lib/stores/sessions.svelte.ts (around toApiParams / initFromParams)
    • /home/roborev/.roborev/clones/wesm/agentsview/internal/db/sessions.go (around buildSessionFilter)
    • /home/roborev/.roborev/clones/wesm/ agentsview/internal/server/sessions.go (query binding)
  • Description: Normalization exists for URL initialization and when toggling "hide-unknown" on, but there is no backend guard. If the project and exclude_project parameters are equal, the resulting SQL becomes project = ? AND project != ?, which will silently return zero rows.
  • Suggested Fix: Normalize the parameters centrally (preferably server-side) before executing the query. If they are equal, either drop one of the filters or return a 400 Bad Request for the invalid combination.

Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

Replace the dot indicator with a colored pill badge showing the agent
name (e.g. CLAUDE, GEMINI) in the sidebar session list. The pill keeps
the pulse-glow animation for recently active sessions.

Switch Gemini from cyan to teal (light: #0d9488, dark: #2dd4bf) for
better visual distinction from Claude's blue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Feb 25, 2026

roborev: Combined Review (975609c)

Summary Verdict: All reviewers agree that the code changes are clean and free of significant issues.

No Medium, High, or Critical issues were found during the reviews.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

wesm and others added 3 commits February 25, 2026 18:00
Replace the heavy solid-color pill badge with a lighter treatment: a
small colored dot paired with the agent name in the agent's accent
color. This integrates better with the sidebar's understated aesthetic
while still making agents instantly distinguishable at a glance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Teal was too close to Codex's green. Rose (light: #e11d48, dark: #fb7185)
is maximally distinct from all other agent colors: blue (Claude), green
(Codex), amber (Copilot), purple (OpenCode).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add max-width on .agent-indicator and text truncation on .agent-label
so unexpectedly long agent names don't compress session content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Feb 26, 2026

roborev: Combined Review (7e0511f)

Review Summary: The changes are mostly secure and well-implemented, with one medium-severity issue identified regarding frontend state management.

Medium

Conflicting filter state is still reachable from UI interactions

  • File: sessions.svelte.
    ts
    (around lines :110 and :292)
  • Problem: Conflict handling is one-directional. If hide UnknownProject is already true and the user later selects project "unknown", the store can still send project=unknown + exclude_project=unknown, producing empty results unexpectedly.
  • Suggested Fix: Centralize normalization before API param construction (or in setProjectFilter). For example, if
    project === "unknown", then force hideUnknownProject = false (or clear project).

Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

Move the project/exclude_project conflict guard into apiParams so no
code path (toggle, URL params, or direct filter mutation) can produce
the contradictory project=unknown&exclude_project=unknown query.
When project is explicitly set to "unknown", exclude_project is
suppressed regardless of hideUnknownProject state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Feb 26, 2026

roborev: Combined Review (c668da7)

Verdict: All agents reviewed the changes and
agree the code is clean, with no Medium, High, or Critical issues identified.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

@wesm wesm merged commit 5b647cf into main Feb 26, 2026
6 checks passed
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.

Claude and Gemini are both blue

1 participant