Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(mail): render an agent namespace as the folder it is, and let overview values be edited in place

merged#2591CedarCopilot

CedarCopilot wants to merge 3 commits into staging from fix/agent-files-wiki-visibility

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 26, 2026, 12:47 PM
  2. Aug 26, 2026, 1:15 PM
  3. Merged
    Aug 26, 2026, 1:57 PM
  4. Live on prod
    Aug 26, 2026, 1:57 PM
  5. Observed 2 days
    Aug 26, 2026, 1:57 PM
  6. Pipelines steady after this deploy
    Aug 26, 2026, 1:57 PM
  7. Unobserved

    Live on prod, no production signal yet

    Aug 29, 2026, 2:23 AM

Behaviors Libra is checking

Email workflow behavior from files/AgentFilesGroup.tsx, files/resolveOpenDoc.ts, strategicOverview/StrategicOverviewTab.tsx keeps working in prod.Inconclusivelow confidence

Strict CloudWatch fallback found 22 recent prod failure log lines for mirror.upsertEmailThread failed (Failed query: insert into \), but the same failure had 3 log lines in the comparable pre-deploy baseline. Libra is not blaming this PR intent without a post-deploy increase or.

prod, checked Aug 29, 2026, 2:23 AM

Libra has verdicts on 0 of 1 tracked behaviors on prod; 1 is still being checked. Libra checks hourly for 3 days after each deploy.

Two reports from varun in #cedar-ode. Both turned out to be a control saying something other than what it does.

1. "I see the wiki maintainer subagent but no wiki in the files"

The wiki was never missing. For conversation df7cb28c…:

agent-8a4d8afb/overview          254 words
agent-8a4d8afb/engagement-wiki   1,621 words, v4   ← what he wanted
agent-8a4d8afb/archives/…        180 words

All three exist and all three are returned by crm.listConversationDocs.

The root cause is that the Files tab modelled an agent as a FILE. AgentDoc had one doc that the row opened, with everything else pushed into files / archives side-arrays behind a collapsed chevron labelled "Show archived". So only one name per agent could ever be on screen, and clicking Wiki Maintainer opened its 254-word run-notes overview.

But an agent namespace is already a real folder in the data , agent-8a4d8afb and agent-8a4d8afb/archives are both documentType: 'folder' rows with real children. Meanwhile ConversationFileTree , the part of this tab that renders folders properly , explicitly excludes every agent- path so the derived section can own them.

Now: buildAgentDocs reproduces the folder. files is what sits directly in it (overview first, since that's the one filename agents are actually told to write); folders is its subfolders. AgentFilesGroup renders that.

šŸ“ Agents
   šŸ“ Wiki Maintainer
      šŸ“„ Overview
      šŸ“„ Engagement Wiki
      šŸ“ Archives          3     ← collapsed
   šŸ“ Meeting Prep
      šŸ“„ Overview
      šŸ“ Archives          1

The archives special-case is deleted, not relabelled

isAgentArchiveDoc regex-matched archives/ and treated the hits as disposable history. Wrong twice over:

  • Those are content. Meeting-prep does not write a file per meeting , it moves the old overview aside and overwrites (agent-doc-convention.ts:7). So archives/2026-08-19 is the Aug 19 meeting prep, a document a rep may well want next month.
  • We already have version history. document_snapshots + document_updates store every Y.js edit and back the history sidebar. archives/ was a second version-control system implemented by asking a language model to remember to move a file first , and that instruction is a plain prompt string, enforced by nothing.

So no folder name is blessed in the UI any more. Subfolders come from the paths; archives renders as "Archives" because that is its name. They start collapsed so dozens of dated runs don't bury the files.

2. "The pencil on the Overview boxes doesn't let me edit the text, it takes me to the Brain tab"

The pencil opened the AOP's field settings in the playbook editor , it chose which fields exist. Meanwhile the values themselves are live <textarea>s with no border, background or focus ring, so they read as static text. The only thing on the card that looked clickable was the one control that couldn't edit anything.

Now: the pencil is gone. Values take a hover/focus tint and are edited by typing into them, the same direct edit the CRM cells give you. Choosing which fields appear keeps its honestly-labelled home in the footer , "Add & configure your overview".

Test plan

  • buildAgentDocs.test.ts , rewritten for the folder shape; adds a non-archives subfolder case proving no folder name is special, and that a file merely named …-archive-… stays an ordinary file.
  • AgentFilesGroup.test.tsx , rewritten: files visible without expanding, folder collapses, subfolder nested and collapsed.
  • filesTabTree.test.tsx , mock updated to the new shape.
  • pnpm --filter @zero/mail exec jest tests/modules/conversations modules/conversations/components → 22 suites, 209 tests, all passing.
  • pnpm --filter @zero/mail run types → clean for every touched file.

šŸ¤– Generated with Claude Code

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/mail/modules/conversations/components/files/AgentFilesGroup.tsxno production surface mapped
  • apps/mail/modules/conversations/components/files/__tests__/AgentFilesGroup.test.tsxno production surface mapped
  • apps/mail/modules/conversations/components/files/__tests__/buildAgentDocs.test.tsno production surface mapped
  • apps/mail/modules/conversations/components/files/resolveOpenDoc.tsno production surface mapped
  • apps/mail/modules/conversations/components/strategicOverview/StrategicOverviewTab.tsxno production surface mapped
  • apps/mail/tests/modules/conversations/filesTabTree.test.tsxno production surface mapped