Skip to content

feat: render API timestamps as RFC3339 in tool output#59

Closed
ysyneu wants to merge 1 commit into
mainfrom
feat/humanize-output-timestamps
Closed

feat: render API timestamps as RFC3339 in tool output#59
ysyneu wants to merge 1 commit into
mainfrom
feat/humanize-output-timestamps

Conversation

@ysyneu
Copy link
Copy Markdown
Collaborator

@ysyneu ysyneu commented May 28, 2026

Summary

  • Flashduty's API returns time fields as bare Unix integers, opaque to an LLM reading tool results. This humanizes them to RFC3339 (in the local timezone) in MarshalResultWithFormat, so every tool response is readable.
  • Detection is by field name (*_time, *_at, timestamp), excluding ID-like fields (*_by/*_id/*_ids); values below 1e9 stay numeric; >=1e12 is treated as millis.
  • Drops the unused, humanization-bypassing MarshalledTextResult.
  • The flashduty-sdk is intentionally untouched — external users consume it directly.

Test plan

  • go build ./... + go test ./... green
  • Unit tests: seconds/millis, field-name detection, ID/duration/zero exclusion, nested/slice, typed struct
  • Wiring test drives the real MarshalResultWithFormat and asserts no raw Unix int leaks
  • gofmt clean

Flashduty's API returns time fields as bare Unix integers, which are opaque to
an LLM reading tool results. Humanize them to RFC3339 (in the local timezone)
in MarshalResultWithFormat so every tool response is readable. Detection is by
field name (*_time, *_at, timestamp), excluding ID-like fields; values below
1e9 stay numeric. Drop the unused, humanization-bypassing MarshalledTextResult.
@ysyneu
Copy link
Copy Markdown
Collaborator Author

ysyneu commented May 29, 2026

Superseded by #60 (rebased onto the merged SDK timestamp design; scoped to SDK adoption, Makefile left untouched).

@ysyneu ysyneu closed this May 29, 2026
@ysyneu ysyneu deleted the feat/humanize-output-timestamps branch May 29, 2026 04:15
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