Skip to content

feat(acp): an adapter's incident is an event, not only a sentence - #22

Merged
tentpegbob merged 1 commit into
mainfrom
feat/acp-adapter-incident-event
Oct 26, 2026
Merged

tentpegbob merged 1 commit into
mainfrom
feat/acp-adapter-incident-event

Conversation

@tentpegbob

Copy link
Copy Markdown

What

The antigravity adapter marks a stream event or step it has no translation
for in the protocol's extension slot — a typed openhands.unrecognised field
on the agent_message_chunk — beside the sentence it puts in the assistant's
text (#20, #21). One hop later, _OpenHandsACPBridge.session_update kept the
chunk's text and let the field go. So "an unrecognised event is surfaced as a
typed error rather than dropped" was true on the wire and false in the
conversation: nothing downstream could count it, and the user's
[unrecognised step: 'system_message'] ×7 could only ever be read by a
person.

ACPAdapterIncidentEvent is the machine-readable half, in the
conversation's own event stream:

class ACPAdapterIncidentEvent(Event):
    source: SourceType = "environment"
    adapter: str                 # 'antigravity', as the adapter named itself
    what: str                    # 'event' | 'step'
    unrecognised_kind: str | None  # not `kind`: that is every event's discriminator
    detail: str                  # the sentence the adapter said, secret-redacted

Emitted live from session_update the way a tool call is, guarded the same
way (a sink that is gone or that raises cannot take the turn down). Persisted
with the rest of the conversation; not sent to the LLM; shown by the
visualizer. The extension slot is read with getattr, since a chunk from an
older protocol package — or a test's narrower stand-in — carries none.

Canvas consumes it (zeroday-ninja/OpenHands, next PR): first sighting of each
(conversation, adapter, what, kind) becomes a runtime-scoped lesson with the
new adapter_incident trigger (zeroday-ninja/automation#79) and a line in
MEMORY.md, and the chat shows a notice that says whether it was filed.

Verification

tests/sdk/agent/test_acp_agent.py
  + test_an_adapter_incident_is_a_typed_event_not_only_a_sentence   (meta → event, text kept, JSON round trip)
  + test_an_incident_with_no_sink_is_not_an_error
tests/sdk/agent/test_acp_agent.py + tests/sdk/event + tests/sdk/acp_servers   661 passed
ruff check / format                                                            clean

🤖 Generated with Claude Code

The antigravity adapter marks a stream event or step it cannot translate in
the protocol's extension slot, as a typed `openhands.unrecognised` field,
beside the sentence it puts in the assistant's text. One hop later the bridge
kept the chunk's text and let the field go, so "surfaced as a typed error
rather than dropped" was true on the wire and false in the conversation —
nothing downstream could count it.

`ACPAdapterIncidentEvent` is the machine-readable half, emitted live from
`session_update` the way a tool call is: adapter, what ('event' or 'step'),
the unrecognised kind, and the sentence. It is persisted with the rest of the
conversation and not sent to the LLM. The field is read tolerantly, since a
chunk from an older protocol package carries no extension slot.

Co-authored-by: openhands <openhands@all-hands.dev>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant