Skip to content

fix(tools): return authoritative datetime fields#1468

Merged
clark-cant merged 1 commit into
nextlevelbuilder:devfrom
itsddvn:fix/datetime-authoritative-weekday
Jul 23, 2026
Merged

fix(tools): return authoritative datetime fields#1468
clark-cant merged 1 commit into
nextlevelbuilder:devfrom
itsddvn:fix/datetime-authoritative-weekday

Conversation

@itsddvn

@itsddvn itsddvn commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • return server-computed UTC and local calendar fields, including weekday and ISO weekday
  • mark calendar fields as authoritative so Qwen does not infer weekdays incorrectly from date strings
  • keep existing utc, unix_ms, local, and timezone fields unchanged, making the response additive and backward compatible
  • add deterministic coverage for local timezone output, UTC-only output, invalid timezones, and zero-value/nil receivers

Root cause

The datetime tool returned timestamps but not explicit calendar fields. Models such as Qwen therefore inferred the weekday from the date and could produce an incorrect answer. Computing these fields in Go makes the tool result authoritative.

Validation

  • go test ./internal/tools -run ^'^TestDateTimeTool' -count=1
  • go test ./internal/tools ./internal/agent ./internal/pipeline -count=1
  • go build ./...
  • go build -tags sqliteonly ./...
  • go vet ./...
  • git diff --check

Surface parity

  • Gateway server: updated builtin datetime tool response
  • API contract: additive tool-result fields; existing fields preserved
  • Web UI: N/A because the UI does not parse datetime tool payloads
  • CLI/runtime package: N/A because the builtin tool is executed server-side

@clark-cant clark-cant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve: additive authoritative UTC/local calendar fields with deterministic tests. No Critical or Important findings; duplicate gate clear, project conventions followed, and all reported CI checks are green.

@clark-cant
clark-cant merged commit 08e8040 into nextlevelbuilder:dev Jul 23, 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.

2 participants