Repository navigation
feat(frontend): pick event fields for an event automation's instruction - #7913
Conversation
Event automations get a pill composer over the instruction, field cards from the catalog payload schema, an include-event checkbox and a preview of the message the agent gets. Run now sends the preview text. Entire-Checkpoint: 01M64ERHZ1AV2Q0Y69M85VKGA1
… the EE spec Entire-Checkpoint: 01M64EX794ZT4M492N6GHXCF64
… the preview rules in the spec Entire-Checkpoint: 01M64GTB160EB5N60Z2PAN9B8M
📝 Summary
Merge Risk:
|
|
🤖 The AI agent says: @coderabbitai review |
|
✅ Action performed
|
Website previewPreview URL: https://pr-7913-agenta-website-preview.mahmoud-637.workers.dev Built from |
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Agenta-AI/agenta
- Branch: feat/automation-event-field-picker
- File: .coderabbit.yaml
- Commit: 161a3a3
- Layers: Repository YAML (base), Organization UI (inherited)
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1000fe08-0c60-4f50-9263-cbdfea726344
Files ignored due to path filters: 2-
web/packages/agenta-api-client/src/generated/api/types/TriggerDeliveryData.tsis excluded by!**/generated/**web/packages/agenta-api-client/src/generated/api/types/TriggerSubscriptionData.tsis excluded by!**/generated/**
Files selected for processing: 30-
openspec/changes/attach-event-to-automation-runs/design.mdopenspec/changes/attach-event-to-automation-runs/specs/automation-event-fields/spec.mdopenspec/changes/attach-event-to-automation-runs/tasks.mdweb/mobile/src/features/automations/AutomationActionsMenu.tsxweb/mobile/src/features/automations/AutomationDetailScreen.tsxweb/mobile/src/features/automations/AutomationTestRunButton.tsxweb/mobile/src/features/automations/runNowText.tsweb/mobile/tests/unit/automationRunNowText.test.tsweb/packages/agenta-automation-ui/src/AutomationCreateBody.tsxweb/packages/agenta-automation-ui/src/AutomationDetailBody.tsxweb/packages/agenta-automation-ui/src/AutomationDrawer.tsxweb/packages/agenta-automation-ui/src/AutomationInstructionField.tsxweb/packages/agenta-automation-ui/src/automationEdit.tsweb/packages/agenta-automation-ui/src/useAutomationCreate.tsweb/packages/agenta-automation-ui/src/useAutomationDraft.tsweb/packages/agenta-entities/src/gatewayTrigger/core/eventFields.tsweb/packages/agenta-entities/src/gatewayTrigger/core/eventMessageTemplate.tsweb/packages/agenta-entities/src/gatewayTrigger/core/eventPreview.tsweb/packages/agenta-entities/src/gatewayTrigger/core/latestDeliveryEvent.tsweb/packages/agenta-entities/src/gatewayTrigger/core/selectorPreview.tsweb/packages/agenta-entities/src/gatewayTrigger/core/types.tsweb/packages/agenta-entities/src/gatewayTrigger/index.tsweb/packages/agenta-entities/tests/unit/gatewayTriggerEventFields.test.tsweb/packages/agenta-entities/tests/unit/gatewayTriggerEventMessageTemplate.test.tsweb/packages/agenta-entities/tests/unit/gatewayTriggerSelectorPreview.test.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/EventFieldCards.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/EventMessageComposer.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/PillEditor.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/index.tsweb/storybook/stories/entity-ui/EventMessageComposer.stories.tsx
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
-
Railway Preview Environment
PR closed or converted to draft. Environment absence verified; retained storage requires separate provider accounting. Post |
…n box The field cards took too much room. Each field is now a small tag that looks like the pill it adds, in one wrapping row inside the instruction box. The provider's description moves into a tooltip on hover and keyboard focus. The header row above the cards is gone. The field list is flat, because the group headers it fed are gone. Entire-Checkpoint: 01M64J8KYFT5DFYVC0JHZNTXBB
…ditor props The selector-to-label map always gave the same label as the selector itself, so the preview, the composer and Run now now call selectorLabel(selector). The placeholder and disabled props had no caller. Helpers only used inside @agenta/entities are no longer exported. Entire-Checkpoint: 01M64JVY0KT8REGGPFMXC27ASN
|
🤖 The AI agent says: QA record for this PR (stacked on #7911). Heads tested. Backend #7911: Tests
Live checks as a real user in /m, on a local stack, with an account made for the test
Blocked, not failed
Minor findings
The headline recording (open an event automation, add a Title pill, see the preview, save, fire an event, see the real title) could not be attached here, because |
…form The backend's JSONPath parser rejects a dot step such as $.event.attributes.123, so that pill reached the agent as empty text while the preview showed the value. Entire-Checkpoint: 01M64K7G4QDY1MDFDG0Q8HN5VV
… does not add it The dispatcher adds the event only to a messages list or to empty inputs. For an agent whose instruction goes under another input key, the preview showed an event block that the agent never got. addsEventText states the backend rule once for the preview. Entire-Checkpoint: 01M64KF40JAPC6T01N2ENE1DAX
…eturn null on failure includesEvent states that a subscription saved without the key reads as on; the draft and Run now both call it. runNowText now logs a failed deliveries call and returns null, so the detail button and the list menu no longer each wrap it in the same try/catch. It also uses addsEventText, the same rule the preview uses. Entire-Checkpoint: 01M64KRZFD3CMT8B8G8X8GVR3V
Copy put only the visible text on the clipboard, so a pasted pill came back as plain label text and stopped filling in. Copy and cut now also write the template under an application/x-agenta-template entry, and paste rebuilds the pills from it. Other apps still get readable text, with each pill as its label. Entire-Checkpoint: 01M64M6FWS6FC0RJ9RYQ9AHWW3
…mpty A pill alone on a field the newest event lacks resolves to empty text. Run now then opened a new session with nothing to send. Both Run now entry points now start only when there is text. Entire-Checkpoint: 01M64MGGKB8YJ6M3GWX7AKZZGC
|
🤖 The AI agent says: Status for the release merge queue (v0.127.2). The building session has stopped pushing to this branch. The queue can merge it at
Two checks are blocked locally. They need a real GitHub account connected through Composio, so they should run during staging QA:
If the keys differ, the pills come out empty. The agent still gets the full event, because the event is included by default, so this is not a release blocker. Deferred and not needed for this release: #7914. |
|
🤖 The AI agent says: Review loop result for head
Fixed: copy, cut and paste keep pills (b6862f6); a key that starts with a digit uses bracket form (65ee14b); the preview adds the event block only where the dispatcher does (c8644ba); redundant label map, unused props and exports removed (10a604a); one |
…mation-event-field-picker
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Agenta-AI/agenta
- Branch: feat/automation-event-field-picker
- File: .coderabbit.yaml
- Commit: 90bf87e
- Layers: Repository YAML (base), Organization UI (inherited)
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fcec2bbd-7fa8-4a65-8e30-3b7251553863
Files ignored due to path filters: 2-
web/packages/agenta-api-client/src/generated/api/types/TriggerDeliveryData.tsis excluded by!**/generated/**web/packages/agenta-api-client/src/generated/api/types/TriggerSubscriptionData.tsis excluded by!**/generated/**
Files selected for processing: 21-
openspec/changes/attach-event-to-automation-runs/design.mdopenspec/changes/attach-event-to-automation-runs/proposal.mdopenspec/changes/attach-event-to-automation-runs/specs/automation-event-fields/spec.mdopenspec/changes/attach-event-to-automation-runs/tasks.mdweb/mobile/src/features/automations/AutomationActionsMenu.tsxweb/mobile/src/features/automations/AutomationTestRunButton.tsxweb/mobile/src/features/automations/runNowText.tsweb/mobile/tests/unit/automationRunNowText.test.tsweb/packages/agenta-automation-ui/src/AutomationInstructionField.tsxweb/packages/agenta-automation-ui/src/useAutomationDraft.tsweb/packages/agenta-entities/src/gatewayTrigger/core/eventFields.tsweb/packages/agenta-entities/src/gatewayTrigger/core/eventMessageTemplate.tsweb/packages/agenta-entities/src/gatewayTrigger/core/eventPreview.tsweb/packages/agenta-entities/src/gatewayTrigger/index.tsweb/packages/agenta-entities/tests/unit/gatewayTriggerEventFields.test.tsweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/EventFieldTags.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/EventMessageComposer.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/drawers/subscription/PillEditor.tsxweb/packages/agenta-entity-ui/src/gatewayTrigger/index.tsweb/packages/agenta-entity-ui/tests/unit/pillEditorClipboard.render.test.tsxweb/storybook/stories/entity-ui/EventMessageComposer.stories.tsx
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
-
Context
A user who makes an event automation ("when a pull request opens in GitHub, review it") cannot see or use what is in the event. The Instruction box on
/mis a plain text box, so the stored instruction is static text. The agent never gets the pull request, the email or the message that started the run. The old field picker was deleted with the old subscription form in89c2d80c39.The backend PR under this one (#7911) adds the full event to the agent's message by default (
data.include_event) and records the event on each delivery (data.event). This PR is the screen for it.Changes
For event automations only, the Instruction field now has four parts. Schedules keep today's plain composer.
createdByreads "Created by") and Composio's own description. A click adds the field as a pill. A card whose field is already in the instruction shows a check.data.include_event. An automation saved before this change has no key, so it reads as checked.[Title].How a pill is stored. A pill is a text part whose text is a selector into the event:
$.event.attributes.<key>. The dispatcher already replaces a selector with its value. For "Review " and the Title pill, the stored mapping is:{"messages": [{"role": "user", "content": [ {"type": "text", "text": "Review "}, {"type": "text", "text": "$.event.attributes.title"} ]}]}A key with characters other than letters, digits and underscores uses the bracket form,
$.event.attributes["a.b"]. A pill is always a text part, even when it is alone, so a field that holds a list stays text.Run now sends the preview text. When the user presses it, the screen fetches the deliveries once, takes the newest recorded event, and builds the text with the same function the preview uses. If that fetch fails, no run starts, the error goes to the console, and the button stays usable. A mapping the composer cannot show (several messages, a non-user message) keeps today's warning and today's Run now text.
Other mapping keys are kept. Reading and writing the instruction now changes only the message key. Before, a builder agent's mapping with a sibling key (for example
"event": "$.event.attributes") showed as an empty box, and a save dropped that key.Where the code sits, mapped to backend layers:
@agenta/entities/gatewayTrigger/coreis the pure-function layer, like acoremodule with pytest tests: the schema-to-cards rules, the template read and write, the preview text, and the newest-event pick. The event text format and the value rule (a string unchanged, null empty, anything else compact JSON) mirror the Python ones and are pinned by the same fixtures.@agenta/entity-uiholds the two reusable components:EventMessageComposer(over a restoredPillEditor) andEventFieldCards.@agenta/automation-uiwires them into the Instruction field and addsincludeEventto the unsaved form state of the create and detail screens (the "draft", like a request body built field by field until Save).web/mobilechanges the Run now button and menu item.The Fern client types for
TriggerSubscriptionDataandTriggerDeliveryDataare regenerated from the EE OpenAPI spec of a stack that runs the backend branch. The run also changed two unrelated generated files (a docstring from another endpoint and the default server URL); they are left out.Scope and risk
/monly. The classic app under/wis not touched.include_event: trueexplicitly.$or/is still read as a selector by the backend. This is a known limit and is not changed here.Tests
@agenta/entitiesunit tests (vitest): 186 files, 2638 tests pass. New tests cover the seven GitHub pull request cards and labels, a nested Linear-style group, bracket selectors and a quoted key with a dot, sibling keys kept on write, a pill moved from a completion shape to a chat shape, the newest event from unsorted rows, the preview with and without an event, the value fixtures (string, number, boolean, object, array, absent), and the shared event text example.web/mobileunit tests: 120 files, 720 tests pass, including a new test for the Run now text (with a delivery, with none, with a failed call, and with a mapping the composer cannot show).@agenta/entities,@agenta/entity-ui,@agenta/automation-uiandweb/mobile.pnpm lint-fixis clean. Storybook lints and builds, with a newEventMessageComposerstory./m, as a new account:$.event.attributes.titlepart. Backspace and the x both remove the pill.jsonb, which reorders keys).What to QA
/m. Under the Instruction box, cards show with Composio's descriptions. Click "Title": a pill appears and the card shows a check.