Skip to content

Output modes: declared on the card, accepted by a request, seen by the worker - #67

Merged
echarles merged 3 commits into
mainfrom
feat/output-modes
Oct 5, 2026
Merged

echarles merged 3 commits into
mainfrom
feat/output-modes

Conversation

@echarles

@echarles echarles commented Oct 5, 2026

Copy link
Copy Markdown
Member
  • FastA2A(default_input_modes=..., default_output_modes=...): the card's default modes, said by the application instead of the fixed application/json (still the default when unsaid). A mode that is not a media type (type/subtype), an empty list, a repeated mode or a bare string is refused when the application is made.
  • acceptedOutputModes from a request's configuration (fasta2a's names and A2A 1.0's alike) is handed to the worker in its task's params as accepted_output_modes, for message/send and message/stream; absent when the client named none.
  • README: an "Output modes" section. Tests: tests/test_output_modes.py.

Released as 2.2.0 once merged.

…pplication, and the modes a request accepts handed to the worker (accepted_output_modes)
Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Media-type validation currently permits case-variant duplicates and non-ASCII names.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds configurable card media modes and forwards client-accepted output modes to workers.

Changes:

  • Validates and publishes default input/output modes.
  • Propagates acceptedOutputModes for send and streaming requests.
  • Documents and tests output-mode behavior.
File Description
fasta2a/​applications.py Adds configurable, validated default modes.
fasta2a/​task_manager.py Forwards accepted modes to workers.
fasta2a/​schema.py Extends internal task parameters.
README.md Documents output-mode usage.
tests/​test_output_modes.py Tests declarations, validation, and propagation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread fasta2a/applications.py Outdated
for mode in declared:
if not isinstance(mode, str) or not _MEDIA_TYPE.fullmatch(mode):
raise ValueError(f'{name}: {mode!r} is not a media type (type/subtype).')
if len(set(declared)) != len(declared):
Comment thread fasta2a/applications.py Outdated
return declared


_MEDIA_TYPE = re.compile(r'[a-z0-9][a-z0-9!#$&^_.+-]*/[a-z0-9][a-z0-9!#$&^_.+-]*', re.IGNORECASE)
… case-insensitive), and the check is ASCII only (no Unicode case folding into [a-z])
…copied as they are both ways; ListTasks reads its status filter as a TaskState
@echarles
echarles merged commit d94dc2f into main Oct 5, 2026
7 checks passed
@echarles
echarles deleted the feat/output-modes branch October 5, 2026 12:51
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.

2 participants