Skip to content

feat: add --override-timestamp to agents send-test-message#74

Merged
yorkable merged 1 commit into
mainfrom
feat/send-test-message-override-timestamp
Jun 1, 2026
Merged

feat: add --override-timestamp to agents send-test-message#74
yorkable merged 1 commit into
mainfrom
feat/send-test-message-override-timestamp

Conversation

@yorkable

@yorkable yorkable commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What & why

Adds an --override-timestamp <iso8601> flag to syllable agents send-test-message, bringing the CLI to parity with the conversation-test API (POST /api/v1/agents/test/messages), whose TestMessage schema already supports override_timestamp.

Date-sensitive agent tests (relative-date fixtures, "two weeks from today") drift daily because the agent's @get_current_datetime returns the real wall clock. This flag pins the agent's time for a turn so those tests are deterministic — without dropping to raw HTTP and re-implementing config/auth resolution.

Resolves ZOO-7809.

Behavior

  • Set → value forwarded verbatim into the request body's override_timestamp.
  • Unset → field omitted entirely; existing invocations produce a byte-identical body.
  • Thin passthrough — no client-side validation; the server validates format and returns a structured 422.

Changes

  • cmd/agents.go — new flag on agentsSendTestMessageCmd(), conditional body inclusion via cmd.Flags().Changed(...) (mirrors the sibling --text pattern), plus help text and an example.
  • cmd/cmd_test.go — two tests: field present when set, omitted when unset.
  • AGENTS.md — documents send-test-message in the Agents section (previously undocumented).

No spec change — override_timestamp already exists in the embedded TestMessage schema.

Verification

  • go build ✅ · go test ./... ✅ · go vet ./cmd/
  • --help lists --override-timestamp with an ISO 8601 example.
  • --dry-run includes override_timestamp iff the flag is passed; the omitted-field body is identical to today's.

🤖 Generated with Claude Code

Surface the TestMessage.override_timestamp field (already present in the
embedded OpenAPI spec) as a flag on `syllable agents send-test-message`.
When set, the value is forwarded verbatim into the request body's
override_timestamp field; when unset, the field is omitted entirely so
existing invocations produce an identical body.

This pins the agent's wall-clock time for a turn, making date-sensitive
agent tests (relative-date fixtures) deterministic without bypassing the
CLI. Thin passthrough: no client-side validation; the server validates
format and returns a structured 422.

ZOO-7809

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@yorkable
yorkable merged commit 5797d57 into main Jun 1, 2026
2 checks passed
@yorkable
yorkable deleted the feat/send-test-message-override-timestamp branch June 1, 2026 18:24
yorkable added a commit that referenced this pull request Jun 1, 2026
…format (#78)

The conversation-test server honors override_timestamp only when it is a
timezone-naive ISO 8601 string (e.g. 2030-12-25T09:30:00, interpreted in the
agent's timezone). Offset (-07:00), 'Z', and space-separated forms are
silently dropped — the agent falls back to the real wall clock with HTTP 200
and no error.

The example shipped in #74 used the offset form, so pasting it was a silent
no-op that defeated the flag's purpose. Correct the example, flag help, and
AGENTS.md to a known-honored tz-naive value and note which forms are ignored;
fix the unit test, which asserted on the offset form.

No behavior change — client-side guarding is tracked as a separate feature
request. (The #74 claim that the server returns a structured 422 was wrong:
override_timestamp is typed anyOf[string,null] with no date-time format, so
there is no schema-level validation.)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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