Skip to content

fix(platform): label reserved workflow comment authors as automation - #4164

Merged
yannickmonney merged 1 commit into
mainfrom
fix/workflow-comment-author
Oct 4, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/workflow-comment-author

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Resolve the reserved agent/workflow author before looking up project agents. Reuse isWorkflowSentinel and the existing timeline.unresolvedWorkflow translations: Automation, Automatisierung, Automatisation (de-CH inherits German). Real missing agents still resolve to the localized deleted-agent fallback; live agents and system retain their names.

The writer audit covers connector comment/status/upsert, overdue task notifications, the sandbox ask_human comment mirror and automation ask retractions. Those rows carry the generic sentinel, not a specific automation identity; this fix does not invent attribution, migrate identities, change writers, or rewrite historical comments. Activity already uses the same generic label when no workflow context is available.

Finding → test map

Finding / acceptance Regression evidence
Reserved workflow incorrectly treated as a removed project agent Actual useActorDirectory and TaskCommentView in task-comments.actors.test.tsx, with the live synthetic roster loaded
All shipped locales Real platform catalogs for en/de/fr and de-CH fallback; expected localized names, not mocked translation keys
Live/deleted/system identities must remain distinct Hook and rendered-comment controls for each identity in each locale
Roster loading must not erase reserved authors Workflow hook regression before the roster loads
Preserve history and do not invent automation attribution Render unchanged synthetic historical body; generic workflow name with no invented preview/link
Accessible name Real avatar role=img, localized accessible name and tooltip; no new control or focus behavior

The platform manual automation register records this coverage. No permissions, schema, migration, keyboard controls or focus code changes. Product guides need no new instructions for this display-only correction.

Verification

Synthetic data only; no production experiments, local backend stack, browser, E2E or container build (fleet light-only constraint). Real comment DOM/component rendering is covered, not a full browser replay. Browser layout/focus inspection remains manual.

On current main aa2e73974a59efeb2b8fa6015be6b1f84e9b731c, before the fix:

Tests  12 failed | 26 passed (38)
workflow: expected "Automation", received "Deleted agent"
de: expected "Automatisierung", received "Gelöschter Agent"
fr: expected "Automatisation", received "Agent supprimé"

After:

Focused hook/comment/timeline/preview checks: 6 files, 85 tests passed
Locale catalog checks: 1 file, 24 tests passed
Direct directory-importer checks: 20 files, 221 passed / 1 timed out (5s)
Isolated retry of unchanged task-modal.repeat.test.tsx: 22/22 passed
Scoped TypeScript: 4 files, 0 diagnostics
  • UI checks: bunx vitest run --config vitest.ui.config.ts --maxWorkers 1 <targeted files>; Node 24 on PATH.
  • Locale checks: bunx vitest run --project server --maxWorkers 1 --silent=false lib/i18n/messages.test.ts.
  • TypeScript API check uses the platform compiler options and test declarations, checks the changed hook/test plus comment and timeline consumers; no whole-workspace tsc.
  • Targeted lint and type-aware lint pass; oxfmt --check, git diff --check, and bun run lint:manual pass.
  • Pre-commit conflict-marker and format hooks pass. The local SAST hook skips because pinned Opengrep is not cached; CI's SAST check is the enforcing gate.
  • The unchanged repeat-dialog test exceeded its 5-second timeout in the broader run; the isolated full-file retry passes without a code/test change. Both results are retained in the delivery evidence.

Closes #4051

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review of PR #4164 at f3e831a58ce8b70663c23c061fd7c3bcbc07c746: accepted, with one LOW follow-up.

Tests (mine)

Source review, cross-checked

  • Only the server writes the workflow sentinel as an author:
    • connectors/task-store.ts:450,464
    • tasks/date-notifications.ts:178
    • automations/ask-retraction.ts:5,43
    • sandbox/workspace_tools_bridge.ts:1138
    • tasks/delegated-start.ts:333,517
  • No real agent can be named workflow: project_agents.id defaults to gen_random_uuid() (0008_projects.sql:68), and inserts never set it.
  • A user can't take the label: isWorkflowSentinel requires actorType === 'agent' (task-actor-preview.ts:70-75).
  • Branch order: workflow, then system, then live agent, then the deleted fallback (use-actor-directory.ts:183-213).
  • Locales: en "Automation", de "Automatisierung", fr "Automatisation". de-CH overrides no timeline.* key, so it inherits German.
  • Accessibility: the avatar is role=img with a matching aria-label and title.
  • Other places now also say Automation: the run-failure banner, the task modal and the timeline. This is consistent with what the timeline already did.
  • No browser render from me. The change picks a label and an avatar, and the PR's DOM tests cover it in four locales.

LOW: the new register row in tests/manual/reference/automation.md:17 is marked ✅ (fully automated), but the same row says "browser layout and focus remain manual", and no box in tasks.md holds that manual part. Either mark it 🔶 and name a box, or drop the clause.

INFO, from before this PR: while the agent roster loads, a live agent briefly reads Deleted agent, because resolveActor ignores agentsLoading (use-actor-directory.ts:207-211).

Merge note: #4164, #4172 and #4178 each insert a row at the top of the same table in automation.md. Whichever merges first, the other two need a one-line rebase. I'm merging this one first, in the manager's age order.

Merge: squash with --match-head-commit through my gate, which dry-runs first.

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.

bug(platform): automation comments appear as Deleted agent

1 participant