Skip to content

chore(release): Bump version to 0.4.1#22

Merged
arcaputo3 merged 5 commits intomainfrom
release/v0.4.1
Mar 17, 2026
Merged

chore(release): Bump version to 0.4.1#22
arcaputo3 merged 5 commits intomainfrom
release/v0.4.1

Conversation

@arcaputo3
Copy link
Copy Markdown
Contributor

@arcaputo3 arcaputo3 commented Mar 13, 2026

Summary

  • Bump build.mill fallback version to 0.4.1
  • Bump package.json version to 0.4.1
  • Update README.md version references to 0.4.1

What's in v0.4.1

  • SDK bump to 0.2.75 (parity with Claude Code v2.1.75)
  • AgentMcpServerSpec ADT for subagent MCP server configuration
  • criticalSystemReminder_EXPERIMENTAL on AgentDefinition
  • onElicitation callback on AgentOptions
  • Session management: renameSession, tagSession, getSessionInfo
  • SessionLogger hardening (JSON escaping, opt-in log dir)
  • AnyOf schema supportJsonSchema.AnyOfType + anyOf() constructor for union type schemas, with Zod conversion via z.union()
  • ToolInput summon for ADT enums — macro tries Expr.summon[ToolInput[T]] before auto-generating schemas, enabling custom JSON encoding for sealed ADT enums

Post-merge

  1. Tag: git tag -a v0.4.1 -m "Release 0.4.1"
  2. Push tag separately: git push origin v0.4.1
  3. CI publishes to Maven Central
  4. Bump to 0.4.2-SNAPSHOT for development

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Mar 13, 2026

PR Review: chore(release): Bump version to 0.4.1

This is a straightforward version bump PR. Here's my assessment:

Summary of Changes

  • build.mill: Fallback publishVersion changed from 0.4.1-SNAPSHOT0.4.1
  • package.json: version changed from 0.4.1-SNAPSHOT0.4.1
  • README.md: All 5 version references updated from 0.4.00.4.1

Observations

Consistency note — README vs build.mill snapshot baseline

The README previously said 0.4.0 (last published release), while build.mill and package.json were already on 0.4.1-SNAPSHOT. This PR resolves that inconsistency correctly by locking everything to 0.4.1.

build.mill fallback version

The pattern Task.env.get("PUBLISH_VERSION").getOrElse("0.4.1") is fine for release, but it means anyone who builds locally without setting PUBLISH_VERSION will produce artifacts stamped 0.4.1. Once this merges and the release tag is cut, you'll want to immediately bump to 0.4.2-SNAPSHOT (as noted in the post-merge checklist) so local builds are distinguishable from the published release. The checklist already calls this out — just flagging it as the most important follow-up.

package.json version

package.json is marked "private": true, so its version field has no publishing impact. The bump is still good for consistency and changelog tooling.

No test changes needed

This is purely a metadata/version bump with no logic changes, so the absence of new tests is appropriate.

Verdict

✅ Looks good to merge. The changes are minimal, correct, and internally consistent. The post-merge checklist (tag → push tag → wait for CI publish → bump to 0.4.2-SNAPSHOT) is exactly the right process.

🤖 Reviewed with Claude Code

arcaputo3 and others added 2 commits March 17, 2026 08:59
The ToolInput macro now tries to summon a user-provided ToolInput[T]
before auto-generating schemas. This handles sealed ADT enums with
custom JSON encoding (e.g. types that accept string | array on the wire)
where the macro can't infer the correct schema from case names alone.

Changes:
- JsonSchema.AnyOfType + anyOf() constructor for union type schemas
- ZodConverter handles AnyOfType via z.union()
- ToolInputMacros.typeToSchemaExpr tries Expr.summon[ToolInput[T]]
  before falling through to auto-generation for enums and unknown types

Usage: define `given ToolInput[MyType]` in the companion object with a
manual schema, and the macro will pick it up automatically when MyType
appears as a field in a derived case class.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Mar 17, 2026

Code Review: v0.4.1 Release PR

Overall this is a clean, well-scoped release PR. The version bumps are consistent across all three files (build.mill, package.json, README.md), and the two feature additions are focused and follow existing patterns well.


JsonSchema.AnyOfType + anyOf() (ToolDef.scala)

Looks good. The new AnyOfType case class and anyOf() constructor fit naturally into the existing JsonSchema ADT. toRaw is consistent with all other schema types.

One edge case to consider: Zod.union([]) with an empty list may throw at runtime. The anyOf() constructor accepts schemas: JsonSchema* with no minimum cardinality enforcement. A guard would prevent surprising errors:

// Optional: fail fast at construction time
def anyOf(schemas: JsonSchema*): JsonSchema =
  require(schemas.nonEmpty, "anyOf requires at least one schema")
  AnyOfType(schemas.toList)

ZodConverter (ZodFacade.scala)

The added case is correct and minimal. No issues.


trySummonToolInput macro (ToolInputMacros.scala)

The design is sound — summon-first is the right priority for custom overrides. The implementation is clean and the comment explaining the BodyContent use case is helpful.

One observation: The summon priority currently only applies to Flags.Enum types and the other (unknown) fallback — it does not apply to case classes (Flags.Case). This means a user cannot override the auto-derived schema for a case class with a custom ToolInput[MyCaseClass]. This may be intentional, but it's worth documenting as a known limitation if so. If override capability is desired for case classes too, the same trySummonToolInput pattern could be added there.

Potential macro footgun: Expr.summon[ToolInput[t]] silently returns None if no instance is in scope. If a user defines a ToolInput given in a file that isn't imported at the macro call site, they'll get the auto-generated schema with no warning. This is standard Scala implicit behavior, but worth noting in the docs/usage comment.


Test coverage

Neither AnyOfType/anyOf() nor the trySummonToolInput path have tests in this PR. For a release, it would be good to have at minimum:

  • A unit test for anyOf toRaw serialization (e.g., anyOf(JsonSchema.string, JsonSchema.array(JsonSchema.string)).toRaw produces {"anyOf": [...]})
  • A macro expansion test for a type with a custom given ToolInput[T] to confirm the summon path is hit

These could be follow-ups if test infrastructure for macros is non-trivial to set up, but the toRaw serialization test would be straightforward with bun test.


Version bump hygiene

The build.mill fallback default changing from 0.4.1-SNAPSHOT to 0.4.1 is correct and expected. The post-merge checklist in the PR description (tag → push → CI publish → bump to 0.4.2-SNAPSHOT) is clear.


Summary: Approve with the suggestion to add serialization tests for AnyOfType before or shortly after merging, and optionally add an input guard on anyOf() for empty schemas.

arcaputo3 and others added 2 commits March 17, 2026 13:59
The trySummonToolInput pattern now applies to case classes too, not
just enums and unknown types. Users can define a custom
`given ToolInput[MyCaseClass]` to override the auto-derived schema.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Mar 17, 2026

PR Review: chore(release): Bump version to 0.4.1

Overall this is a clean release PR. The version bumps are straightforward and the two substantive changes (macro improvement + AnyOf schema support) are well-structured. A few observations below.


✅ What's good

  • trySummonToolInput pattern is a solid design — checking for explicit ToolInput[T] instances before falling back to auto-generation is the right priority order. It makes the macro extensible without breaking existing users.
  • AnyOfType follows the existing JsonSchema ADT pattern cleanly, and the Zod conversion (Zod.union) maps correctly.
  • The trySummonToolInput helper is properly shared across all three macro branches (enum, case class, unknown), which is consistent.

⚠️ Potential Issues

1. Zod union requires ≥ 2 types at runtime

Zod throws if z.union([]) or z.union([oneType]) is called. The anyOf() constructor has no guard:

def anyOf(schemas: JsonSchema*): JsonSchema = AnyOfType(schemas.toList)

Consider validating at construction time:

def anyOf(schemas: JsonSchema*): JsonSchema =
  require(schemas.length >= 2, s"anyOf requires at least 2 schemas, got ${schemas.length}")
  AnyOfType(schemas.toList)

2. AnyOfType with a single schema in ZodConverter

Similarly, if AnyOfType(List(one)) somehow reaches ZodConverter.toZodType, it will produce Zod.union(js.Array(oneType)) which will throw at runtime. A defensive fallback like unwrapping single-schema AnyOf to the schema itself would be safer.

3. Potential implicit summon ambiguity for case classes

The Case branch now calls trySummonToolInput first. If the macro-derived given ToolInput[T] is in scope at the call site (from a derives ToolInput on the same type), this could cause unexpected behavior — the summon might either succeed with the derived instance (circular) or fail, depending on Scala's implicit resolution order during macro expansion. Worth a note in the docs or a targeted test case.


🧪 Test Coverage

There are no tests added for:

  • JsonSchema.anyOf(...) / AnyOfType.toRaw output
  • ZodConverter handling of AnyOfType
  • The trySummonToolInput path for enums and case classes with explicit ToolInput instances

Given these are user-facing API additions, even a few unit tests in the MUnit suite would help prevent regressions.


📋 Minor

  • The fallback version in build.mill changing from 0.4.1-SNAPSHOT0.4.1 is correct for a release PR. The post-merge note about bumping to 0.4.2-SNAPSHOT is a good reminder — consider whether that bump should be a follow-up PR rather than a manual step.
  • package.json version bump is consistent. Since this is a Scala library and package.json is marked "private": true, this is mainly for tracking — looks fine.

Summary: The core implementation is sound. The main risk is the missing lower-bound validation on anyOf / AnyOfType that could surface as a runtime Zod error. Recommend adding that guard plus at minimum a couple of regression tests before merging.

🤖 Generated with Claude Code

@arcaputo3 arcaputo3 merged commit 0f8a3c3 into main Mar 17, 2026
3 checks passed
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