CedarCopilot wants to merge 2 commits into main from staging
Not deployed
Libra has no production signal for this change yet because it has not deployed. Libra checks hourly for 3 days after each deploy.
This change improves synchronization of subagent descriptions, but removing a description can leave stale metadata in generic document listings. It also introduces a test assertion that conflicts with an explicit repository requirement and must be corrected before merging.
Do not merge until the repository-required TypeScript narrowing is applied. The stale listing metadata issue is a non-blocking data-consistency concern.
The final findings are limited to data consistency and an explicit repository requirement.
Files Needing Attention: apps/server/src/db/migrations/scripts/backfill-agent-description-column.ts; apps/server/src/db/migrations/scripts/tests/backfill-agent-description-column.test.ts
What T-Rex did
### Issue 1
apps/server/src/db/migrations/scripts/backfill-agent-description-column.ts:129-137
**Clear removed descriptions**
When a custom subagent is saved after its frontmatter `description` is removed, the document write retains the previous generic description value. This branch then reports `cannot-clear` and skips the update, so generic document listings can continue showing metadata that the author removed. Define an explicit clearing policy for a missing frontmatter description, either when saving the subagent or in this migration. This is non-blocking, but it leaves misleading listing metadata behind.
### Issue 2
apps/server/src/db/migrations/scripts/__tests__/backfill-agent-description-column.test.ts:39
**Narrow the result first**
This assertion uses `as { truncated: string }` instead of narrowing the `DescriptionSyncPlan` union through `result.action`. This violates the repository directive against TypeScript assertions used to silence the type system. The repository requirement must be satisfied before merging.
```suggestion
expect(result.action).toBe('sync');
if (result.action === 'sync') expect(result.truncated).toHaveLength(200);
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Reviews (1): Last reviewed commit: "Merge pull request #2721 from CedarCopil..." | Re-trigger Greptile
Greptile also left 2 inline comments on this PR.
Context used:
Libra has not measured any production surfaces for this change yet.