chore: bump SDK to 0.2.78 with parity updates#25
Conversation
Add StopFailure hook event (fires when agent fails to stop cleanly) and BridgeMetadata system message (carries slash_commands). Includes parsing, tests, and package.json version pin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR Review: chore: bump SDK to 0.2.78 with parity updatesOverall this is a clean, focused PR. The new Issues1. In case Some("api_retry") =>
guardTopLevelUnknown(raw, "system", Some("api_retry"), context) { // ✅
parseApiRetryMessage(obj, raw)
}
case Some("bridge_metadata") =>
AgentMessage.BridgeMetadata( // ❌ no guard
slashCommands = stringArrayField(obj, "slash_commands"),
...
)Unless 2.
Consider adding a case BridgeMetadata(
@jsonField("slash_commands") slashCommands: List[String],
uuid: MessageUuid,
sessionId: SessionId
)3. Version pin in // before
"@anthropic-ai/claude-agent-sdk": "^0.2.77"
// after
"@anthropic-ai/claude-agent-sdk": "0.2.78"The caret was dropped, pinning to an exact version. This is inconsistent with the other dependencies ( Minor Observations4.
error = AssistantMessageError.fromString(firstString(raw, "error").getOrElse("unknown")),Other fields on the same struct (e.g., 5. Missing edge-case tests
What's Good
🤖 Generated with Claude Code |
- Wrap bridge_metadata parsing with guardTopLevelUnknown for consistency
- Add @jsonField("slash_commands") annotation for JSON round-trip correctness
- Restore caret in package.json version specifier
- Add edge-case tests: StopFailure with missing error, empty slash_commands
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code ReviewOverall this is a clean, focused PR that follows the established patterns well. A few observations: Strengths
Minor Observations1. Missing test: There's no test verifying behaviour when test("parses bridge_metadata with missing slash_commands"):
val raw = js.Dynamic.literal(
`type` = "system",
subtype = "bridge_metadata",
uuid = "msg-bridge-3",
session_id = "session-1"
)
MessageConverter.fromRaw(raw) match
case AgentMessage.BridgeMetadata(slashCommands, _, _) =>
assertEquals(slashCommands, Nil)
case other =>
fail(s"Expected BridgeMetadata, got: $other")2.
3. The annotation is correct for the ZIO JSON codec, but the actual streaming parse path in SummaryNo blocking issues. The two main additions ( |
Summary
@anthropic-ai/claude-agent-sdkfrom 0.2.77 to 0.2.78StopFailurehook event — fires when the agent fails to stop cleanly (e.g., API error during stop)BridgeMetadatasystem message — carriesslash_commandsmetadataTest plan
./mill agent.compilepasses./mill agent.testpasses (new tests for StopFailure parsing and bridge_metadata parsing)./mill examples.compilepasses🤖 Generated with Claude Code