Skip to content

fix agent share card details - #124

Merged
cynfria merged 21 commits into
mainfrom
fix/agent-card-info-fix
Aug 20, 2026
Merged

fix agent share card details#124
cynfria merged 21 commits into
mainfrom
fix/agent-card-info-fix

Conversation

@cynfria

@cynfria cynfria commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Category: fix
User Impact: Shared agent cards now show accurate, concise descriptions and real “Good for” and “Vibes” details without exposing private instructions.
Problem: Agent cards could show placeholder or inferred data, truncate long instruction text, and lose curated metadata across imports and downloads. A stale installed Agt. Builder could also continue shadowing the corrected bundled definition.
Solution: Carry validated card metadata through every supported format, derive safe concise fallback descriptions, offer explicit model-assisted generation, and narrowly migrate only the exact known stale bundled artifact.

File changes

scripts/validate-bundled-agents.ts
Requires short, grapheme-bounded good_for and vibes metadata for bundled agents.

src-tauri/src/services/bundled_agents.rs
Recognizes and replaces only the exact historical stale Agt. Builder file while preserving modified and user-owned files.

src-tauri/test-fixtures/legacy-agt-builder.md
Provides the exact historical artifact used to verify the migration signature.

src/features/agents/agent-snapshot/mapping.test.ts
Covers portable card metadata and Unicode-safe round trips.

src/features/agents/agent-snapshot/mapping.ts
Carries goodFor and vibes through portable agent snapshots.

src/features/agents/agent-snapshot/schema.ts
Validates portable card metadata with grapheme-aware bounds.

src/features/agents/ui/AgentImportDialog.tsx
Uses public preview descriptions and real card metadata without exposing imported instructions.

src/features/agents/ui/tests/AgentImportDialog.test.tsx
Covers authored and generic privacy-safe import preview descriptions.

src/features/agents/ui/share-card/AgentShareDialog.test.tsx
Covers description generation lifecycle, cancellation, reopening, and preview/export consistency.

src/features/agents/ui/share-card/AgentShareDialog.tsx
Displays real metadata, supports explicit model-generated descriptions, and renders reviewed copy into downloads.

src/features/agents/ui/share-card/agentShareCard.test.ts
Verifies instruction-derived card descriptions and existing rendering behavior.

src/features/agents/ui/share-card/agentShareCard.ts
Accepts the reviewed description when rendering downloadable cards.

src/features/agents/ui/share-card/agentShareCardCopy.test.ts
Covers metadata precedence, length limits, and readable localization fallbacks.

src/features/agents/ui/share-card/agentShareCardCopy.ts
Prefers validated agent metadata while retaining short classified fallbacks.

src/features/agents/ui/share-card/agentShareCardDescription.test.ts
Covers safe extraction and generic fallback behavior.

src/features/agents/ui/share-card/agentShareCardDescription.ts
Derives concise public descriptions from recognized role statements without copying arbitrary instructions.

src/features/agents/ui/share-card/agentShareCardDescriptionInference.test.ts
Covers hidden tool-free inference, caching, provider readiness, and malformed-output fallback.

src/features/agents/ui/share-card/agentShareCardDescriptionInference.ts
Generates optional descriptions through a hidden, cancellable, tool-free model session after explicit user action.

src/shared/api/tests/agents.test.ts
Covers metadata hydration, precedence, sanitization, imports, exports, and native JSON promotion.

src/shared/api/agents.ts
Normalizes and preserves card metadata across source listing, Markdown, JSON, import previews, and exports.

src/shared/i18n/locales/en/agents.json
Adds English copy for optional description generation.

src/shared/i18n/locales/es/agents.json
Adds Spanish copy for optional description generation.

src/shared/lib/graphemeCount.ts
Provides shared Unicode grapheme counting for card limits.

src/shared/runtime-config/validateBundledAgents.test.ts
Covers required and bounded bundled-agent card metadata.

src/shared/types/agents.ts
Adds typed card metadata to personas and creation requests.

Verification

  • just check
  • just tauri-check
  • focused frontend test suites
  • bundled-agent migration tests
  • review-fix loop with final general and Wes reviews clean

@cynfria
cynfria requested a review from a team August 19, 2026 20:26

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the exact three-dot comparison introduces two blocking regressions: public share cards discard authored public descriptions in favor of instruction-derived text, and the legacy bundled-agent replacement can overwrite a concurrently edited user file. Three non-blocking issues remain around model-backed generation compatibility, localization, and snapshot normalization. Supplied GitHub evidence was inspected; frontend checks were still in progress at capture time, while the other reported checks had completed successfully. Required checks independently govern merge readiness.

Deterministic publication result: 2 blocking and 3 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/ui/share-card/agentShareCard.ts Outdated
Comment thread src-tauri/src/services/bundled_agents.rs
Comment thread src/features/agents/ui/share-card/agentShareCardDescriptionInference.ts Outdated
Comment thread src/shared/api/agents.ts Outdated
Comment thread src/features/agents/agent-snapshot/schema.ts Outdated

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found one blocking migration race and three non-blocking share-card generation lifecycle/consistency issues. All five prior automated threads were inspected; their original issues are fixed except that the migration's replacement path still has a different concurrent-writer overwrite window, which is eligible to be raised again because the resolved thread has no substantive human reply. Supplied GitHub evidence was inspected: frontend checks and unit tests, macOS/Windows Rust checks, clean-room install, and DCO had succeeded; Linux Rust checks were in progress and two additional checks were queued at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 3 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/src/services/bundled_agents.rs Outdated
Comment thread src/features/agents/ui/share-card/AgentShareDialog.tsx
Comment thread src/features/agents/ui/share-card/agentShareCardDescriptionInference.ts Outdated
Comment thread src/features/agents/ui/share-card/AgentShareDialog.tsx Outdated
@cynfria
cynfria requested a review from morgmart August 19, 2026 21:27

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found two blocking issues and two non-blocking issues. The legacy migration can still discard edits written through an already-open file descriptor, and the new snapshot description boundary rejects valid generated or authored descriptions based on UTF-16 length, breaking card downloads. The description-generation setup deadline remains an existing unresolved automated thread and is suppressed from new findings. Final self-check covered the share preview/generate/download/import flows, migration lifecycle and concurrency, accessibility, localization, consent boundaries, async/error/never-completes/race behavior, tests, project rules, anchors, overlap, and severity evidence. Supplied GitHub evidence was inspected; all listed check runs had completed successfully, while combined status was still reported as pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 2 blocking and 2 non-blocking finding(s) publishable; 1 duplicate(s) suppressed.

Comment thread src-tauri/src/services/bundled_agents.rs Outdated
Comment thread src/features/agents/agent-snapshot/schema.ts Outdated
Comment thread src/features/agents/ui/share-card/AgentShareDialog.tsx
Comment thread src/features/agents/ui/share-card/agentShareCardDescription.ts Outdated
@cynfria
cynfria requested a review from morgmart August 19, 2026 22:16

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found two blocking migration races and two non-blocking boundary/round-trip issues. Recovery can still overwrite a target created between an existence check and rename, and intentionally retained recovery backups can be overwritten after a PID/name collision. All supplied review threads were inspected; the recovery race is eligible to be raised again because the related resolved automation threads contain no substantive human reply, while the backup-name collision is a distinct issue. Final self-check covered every changed share/import/download and migration flow, accessibility, i18n, consent/navigation boundaries, async/error/never-completes/lifecycle/races, test honesty, design-system/project rules, duplicate overlap, anchors, and blocking user-effect evidence. Supplied GitHub evidence was inspected: all listed checks except the macOS Rust check had completed successfully, and that check plus combined status were still in progress/pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 2 blocking and 2 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/src/services/bundled_agents.rs Outdated
Comment thread src-tauri/src/services/bundled_agents.rs Outdated
Comment thread src/features/agents/agent-snapshot/schema.ts Outdated
Comment thread src/features/agents/ui/share-card/agentShareCardDescription.ts Outdated
@cynfria
cynfria requested a review from morgmart August 19, 2026 22:48

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found two blocking regressions and one non-blocking preview/import inconsistency. The new legacy-file transaction has no recovery for interruption after moving the canonical file, and the unchanged v1 snapshot version now rejects previously valid long profile.about values. All 17 supplied review threads, their resolution states, replies, authors, bodies, and URLs were inspected; these are distinct current issues rather than duplicates of the resolved automated findings. Final self-check covered every changed share preview/download/import and migration flow, accessibility, i18n, navigation and consent boundaries, async/error/never-completes/lifecycle/races, test honesty, design-system/project rules, duplicate overlap, valid anchors, and concrete blocking user effects. Supplied GitHub evidence was inspected; every listed check run had completed successfully, although combined status remained pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 2 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/src/services/bundled_agents.rs Outdated
Comment thread src/features/agents/agent-snapshot/schema.ts Outdated
Comment thread src/shared/api/agents.ts
@cynfria
cynfria requested a review from morgmart August 19, 2026 23:15

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found one blocking migration race and two non-blocking presentation/runtime issues. The simplified legacy replacement again authorizes by hashing and then performs a replacement-capable rename, allowing a concurrent user edit to be overwritten. All 20 supplied review threads, resolution states, replies, authors, bodies, and URLs were inspected; this migration issue may be reopened because the related threads are resolved with no substantive human reply. Final self-check covered every changed share preview/download/import and migration flow, accessibility, i18n, navigation and consent guards, async/error/never-completes/lifecycle/races, test honesty, design-system/project rules, duplicate overlap, anchors, and blocking evidence plus user effect. Supplied GitHub evidence was inspected; Rust checks, DCO, and clean-room install had succeeded, while frontend checks were in progress and combined status was pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 2 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

})?;
match installed_agent_path_state(target)? {
InstalledAgentPathState::Missing | InstalledAgentPathState::Bundled => {}
InstalledAgentPathState::UserOwned if is_known_legacy_agt_builder(target)? => {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 P1 · Bind verification to replacement (blocking)

The legacy exception re-checks that target still has the historical hash and then calls fs::rename(temp_path, target). Those operations are not atomic. A user or another Berd process can modify or replace agt-builder.md after the hash check but before rename; the rename then replaces the newly user-owned file. This is the original migration data-preservation issue reintroduced by removing the claim flow, and the related resolved automation threads contain no substantive human reply.

User effect: A user saving Agent Builder during startup can lose their edits when Berd replaces the file after validating an earlier version of its contents.

Recommended fix: Use an atomic compare-and-replace strategy that binds authorization to the exact inode/content being replaced, or preserve the target and skip migration whenever it changes. Do not follow a hash check with an unconditional replacement-capable rename.

Test: Deterministically modify or replace target after the final historical-hash check but before publication, then assert the concurrent user file remains byte-for-byte intact and migration does not report success.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Product decision: replacing the exact known historical Agt. Builder is intentional even if it is concurrently edited during the final check/rename window. Customized files present before verification remain protected by the exact-content signature. We are not adding migration transaction machinery for this accepted edge case.

Comment thread src/features/agents/ui/share-card/AgentShareDialog.tsx Outdated
Comment thread src/shared/lib/graphemeCount.ts
@cynfria
cynfria requested a review from morgmart August 19, 2026 23:54

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

COMMENT: the fresh full review of the exact three-dot comparison found one new non-blocking v1 compatibility issue. The legacy migration's hash-check/rename race remains present, but the same underlying issue already has an unresolved automated thread and is therefore suppressed from findings. All 23 supplied review threads, resolution states, replies, authors, bodies, and URLs were inspected. Final self-check covered every changed share preview/download/import and migration flow, accessibility, i18n, navigation and consent guards, async/error/never-completes/lifecycle/races, test honesty, design-system/project rules, duplicate overlap, anchors, and severity evidence. Supplied GitHub evidence was inspected; all listed checks except transcript virtualization had completed successfully, while that check was in progress and combined status was pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 0 blocking and 1 non-blocking finding(s) publishable; 1 duplicate(s) suppressed.

Comment thread src/features/agents/agent-snapshot/schema.ts Outdated
@cynfria
cynfria requested a review from morgmart August 20, 2026 16:13

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

COMMENT with no new publishable findings: the fresh full review of the exact three-dot comparison found no genuinely new issue after duplicate suppression. The legacy migration's hash-check/rename race remains present, but the same underlying blocking issue already has an unresolved automated thread and must not be republished; that unresolved thread also prevents an approval recommendation. All 24 supplied review threads, resolution states, replies, authors, bodies, and URLs were inspected. Final self-check covered every changed share preview/download/import and migration flow, accessibility, i18n/localization, navigation and consent guards, async/error/never-completes/lifecycle/races, test honesty, design-system/project rules, duplicate overlap, anchors, and blocking evidence plus user effect. Supplied GitHub evidence was inspected; every listed check run had completed successfully, although combined status remained pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 0 blocking and 0 non-blocking finding(s) publishable; 1 duplicate(s) suppressed.

@cynfria
cynfria merged commit d9e9fa8 into main Aug 20, 2026
8 checks passed
@cynfria
cynfria deleted the fix/agent-card-info-fix branch August 20, 2026 17:54
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