Skip to content

feat(agentfabric): Add support for artifact and status update echo node types#56

Closed
Drake-Ash wants to merge 3 commits into
salesforce:mainfrom
Drake-Ash:add-support-for-artifact-and-status-update-echo-node-types
Closed

feat(agentfabric): Add support for artifact and status update echo node types#56
Drake-Ash wants to merge 3 commits into
salesforce:mainfrom
Drake-Ash:add-support-for-artifact-and-status-update-echo-node-types

Conversation

@Drake-Ash

@Drake-Ash Drake-Ash commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

Redesigns the AgentFabric echo node around A2A v1 task-update events, replacing the single
a2a:response variant with two purpose-built event types, and adds graph-aware lint rules to
enforce correct terminal behavior.

The echo node now supports two kind variants:

  • a2a:status_update_event — sets the task state (required; an A2A v1 TASK_STATE_*
    value) with an optional message.
  • a2a:artifact_update_event — emits an artifact (required) with optional append and
    lastChunk flags.
echo setStatus:
  kind: "a2a:status_update_event"
  state: "TASK_STATE_COMPLETED"
  message: a2a.message({
    messageId: uuid(),
    parts: [ a2a.textPart("You have been onboarded! ...") ]
  })

echo addArtifact:
  kind: "a2a:artifact_update_event"
  artifact: a2a.artifact({ artifactId: uuid(), name: "results", parts: [ a2a.textPart("Analysis
complete") ] })
  append: False
  lastChunk: False

Why

The previous a2a:response echo wrapped a full A2A Task object (via a2a.task(...)) and only
supported non-streaming responses. Modeling responses as discrete A2A v1 task-update events
(status vs. artifact) aligns the dialect with the A2A v1 task lifecycle, enables
incremental/streaming artifact updates, and lets the linter statically guarantee that every
execution path drives the task to a terminal state.

How

Schema (src/schema.ts)

  • Replaced the a2a:response variant (with task/artifacts/message/metadata) with the two
    event variants above.
  • a2a:status_update_event: state is required and constrained to the A2A v1 TASK_STATE_*
    enum; message is optional.
  • a2a:artifact_update_event: artifact is required; append/lastChunk are optional
    booleans.
  • Exported A2A_TASK_STATES (the 8 TASK_STATE_* values) and A2A_TERMINAL_STATES for shared
    use across schema, compiler, and linter.
  • Removed the a2a.task namespaced function; a2a.message / textPart / dataPart /
    filePart / artifact / parts remain.

Lint rules

  • terminal-requires-status-update (new, terminal-status-rules.ts): every terminal branch
    in the graph must reach an a2a:status_update_event echo with a terminal state. Uses graph
    extraction + reverse-BFS so the status echo need not be the leaf node (a branch may continue
    afterward, e.g. to emit an artifact or run cleanup).
  • echo-invalid-state (new, in echo-rules.ts): validates that a status-update echo's
    state is a known A2A v1 task state.
  • Removed echo-task-or-message-required, which no longer applies under the event model.

Other

  • Bumped @agentscript/agentfabric-dialect 0.1.300.4.0 (breaking) and added a CHANGELOG
    entry.
  • Updated the AgentFabric docs (apps/docs) for the new echo node, field tables, and a2a
    namespace notes.
  • Migrated test fixtures (.agent / .yaml / .graph.json) and all inline test sources to the
    new event variants; the customer-support fixture now also exercises a chained status_update
    artifact_update echo.

Breaking change / migration

Flows using kind: "a2a:response", the task: or artifacts: echo fields, or a2a.task(...)
must migrate. Replace the response with a status-update echo (set a terminal TASK_STATE_*) and,
where artifacts were attached, an a2a:artifact_update_event echo:

-echo done:
-  kind: "a2a:response"
-  task: a2a.task({ state: "completed", message: a2a.message({ ... }) })
+echo done:
+  kind: "a2a:status_update_event"
+  state: "TASK_STATE_COMPLETED"
+  message: a2a.message({ ... })

Test Plan

  • Existing tests pass — pnpm --filter @agentscript/agentfabric-dialect test144
    passed
    (incl. 61 lint tests)
  • New/updated tests cover the change — added cases for terminal-requires-status-update
    (terminal node not an echo, non-terminal state, valid terminal echo,
    status-echo-then-more-nodes), echo-invalid-state, and unknown-variant for the removed
    a2a:response kind
  • Type checks pass — pnpm --filter @agentscript/agentfabric-dialect typecheck clean

Checklist

  • My code follows the project's coding style
  • I have reviewed my own diff
  • I have added/updated documentation as needed (apps/docs + dialect CHANGELOG)
  • This change does not introduce new warnings

…ifact-and-status-update-echo-node-types

# Conflicts:
#	dialect/agentfabric/src/lint/passes/rules/terminal-status-rules.ts
@Drake-Ash Drake-Ash closed this Jun 10, 2026
@Drake-Ash Drake-Ash deleted the add-support-for-artifact-and-status-update-echo-node-types branch June 10, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants