Repository navigation
fix(platform): open the waiting run from a project agent's question - #5090
tale-code-bot wants to merge 3 commits into
Conversation
An agent that asks a question on a project's run that works no task writes a row naming the project, the run and the automation. The bell and the REST export opened the project's task board, which has no answer card, while the email already opened the run: the in-app target tried the project fallback before the run. The run now comes before the project fallback, as in the email link. Only an agent's question carries both the run and the automation name, so no other row changes where it leads.
NOTIF-F13a clicks through from the bell to the answer card; the unit specs that hold the link's three paths are listed in the suite's automation coverage.
The link tests for a question on a project run with no task build the row by hand. This one runs the real emitter, notifyAgentQuestionAsked, and gives the row it writes to the bell's target and the email's link: both open the run. A key renamed on either side now fails a test instead of sending people to the project's board. The automation register lists the spec for NOTIF-F13a.
tale-review-bot
left a comment
There was a problem hiding this comment.
Approved at 1121f090598261ba7eefb869a066f3566102f9e0.
Checked
- Diff: read in full, all 10 files.
- In
personalNotificationTarget, therunId+namebranch now comes after the task branch and before the project-only fallback, the same precedence asbuildPersonalNotificationUrl. - Only
notifyAgentQuestionAsked(agent_escalation) writesrunIdtogether withname.notifyAutomationMessagewritesautomation/runIdand noname, so no other row type changes target. - Task-bound asks still open the task.
- In
- Access: a taskless project ask goes only to owners, admins and developers who can see the project (
askAudienceUserIds)./dashboard/$id/automations/*admits exactly those roles (AutomationsAccessGate), so every recipient can open the run. - Tests run locally, credentials unset:
vitest.ui.config.ts(notification-target, parity): 101 passed.--project server(personal_notification_url, v1-notifications, collab service, domain-specs guard): 93 passed.
- Regression proof: with
lib/shared/notifications/target.tsreverted to base9be5cada, 4 of the new tests fail. They are the bell, theagent_escalationparity row, the REST export and the real-emitter test, each getting/projects/<id>/tasksinstead of the run. The controls and the email test pass. - Contract:
- branch
fix/…, commitlint-shaped commits and title,Closes #3632; - the NOTIF-R3 card has an example and its tests name it;
- box
NOTIF-F13aand its register row are in.
- branch
- CI on this head: all seven
CI readychecks pass (Checks run 40920535220, SAST 40920535049, Commitlint 40920535095).
Not run: the merge-queue tiers (UI, E2E, Build), the rendered click-through (NOTIF-F13a), and a live API readback.
|
Not landing yet. The green
|
|
Reopened so the checks run again. The 20:13–20:15 UTC reopen started its runs from a test merge into |
|
Landed on |
Summary
An agent's question on a project run that works no task now opens the run in the bell, matching the email. Before, the bell opened the project's task board, which has no answer card. Task TALE-26, issue #3632.
Cause. The question's row names the project, the run, the ask and the automation (
notifyAgentQuestionAsked, taskless arm).personalNotificationTarget(lib/shared/notifications/target.ts) checked theprojectIdfallback before the run branch, so the bell and the REST export/notifications/sync?stream=personalopened/dashboard/<org>/projects/<projectId>/tasks.buildPersonalNotificationUrlalready opened/dashboard/<org>/automations/<slug>/runs/<runId>for the same row.Fix. The run branch (
runId+name) now runs before the project fallback, in the same order as the email builder.notifyAgentQuestionAskedwrites that pair, so no other notification type changes destination.Who receives it. For a taskless run, recipients are owners, admins and developers who can see the project (
askAudienceUserIds), and they can all open the run detail.docs/en/platform/automations/approvals-in-workflows.mdalready says "Owners, Admins, and Developers answer on the run detail".Commits
fix(platform): the reorder and comments, the parity row innotification_link_cases.ts, and regression tests for the bell, the email and the REST export. Spec rule NOTIF-R3 now reads "a run with no task, in a project or not → the run".docs(manual): boxNOTIF-F13a(click-through to the answer card) and its automation-register row.test(platform): runs the real emitter for a project's run with no task and gives the row it writes to both link builders. A key renamed on either side now fails a test.Closes #3632
Checklist
bun run check: not run in full in my sandbox. This worker has a 4 GiB memory limit, and the fulltscneeds the 6 GiB heap CI gives it.oxlint --type-aware --type-checkon the six touched files outsidelib/shared(the platform's.oxlintrc.jsonignoreslib/shared);tscover a program rooted at all seven touched TypeScript files, 0 errors;lint:manual;oxfmt --check.bun run lint:sast: not run in my sandbox. The pinned Opengrep binary isn't cached there, so the pre-commit scan skipped it. CI's Opengrep job (run 40920535049) was still pending when I checked.docs/{en,de,fr}/platform/automations/approvals-in-workflows.mdalready describe answering on the run detail; the bell now matches them.Test plan
All commands run from
services/platform, on head1121f090598261ba7eefb869a066f3566102f9e0.Fail before the fix (tests only;
target.tsas onmain9be5cadacb5f):bunx vitest --run --config vitest.ui.config.ts app/features/notifications/lib/notification-target.test.ts app/features/notifications/lib/notification-target.parity.test.tsopens the run for a question on a project run with no task [NOTIF-R3]and theagent_escalationparity row. The bell returned/dashboard/org_case/projects/proj_1/tasks.bunx vitest --run --project server backend/core/notifications/personal_notification_url.test.ts backend/rest/v1-notifications.test.tspathwas/dashboard/org/projects/project%2Fone/tasks. The email test already passed: the email was right all along.bunx vitest --run --project server backend/domains/collab/service.test.ts -t "links a question on a project run with no task"/dashboard/org-1/projects/proj-1/tasks.Pass on this head:
app/features/notifications/components/notification-list-panel.test.tsxandapp/features/notifications/components/notification-bell.test.tsxbunx vitest --run --project server backend/core/notifications/personal_notification_url.test.ts backend/rest/v1-notifications.test.ts backend/domains/collab/service.test.ts backend/core/collab/coalesce.test.ts backend/domains/automations/store.terminal-asks.test.ts tests/guards/domain-specs.guard.test.tsbunx oxlint --type-aware --type-checkon the six touched files outsidelib/sharedTS2322.tscwith the platform's config, over a program rooted at the seven touched TypeScript filesbun run lint:manualoxfmt --checkon the changed filesNot run:
/notifications/synchandler with the store mocked.NOTIF-F13aintests/manual/suites/notifications.md:ask_humanwith no task subject.