Skip to content

fix(logging): honor local timezone in pretty console timestamps#1

Open
Sid-Qin wants to merge 1 commit intomainfrom
fix/console-local-time-25943
Open

fix(logging): honor local timezone in pretty console timestamps#1
Sid-Qin wants to merge 1 commit intomainfrom
fix/console-local-time-25943

Conversation

@Sid-Qin
Copy link
Owner

@Sid-Qin Sid-Qin commented Feb 25, 2026

Summary

  • Problem: subsystem console lines used toISOString() for pretty/compact timestamp prefixes, which always renders UTC time.
  • Why it matters: operators running in non-UTC timezones see misleading log times that do not match local runtime configuration.
  • What changed: subsystem timestamp rendering now uses the shared formatConsoleTimestamp() helper for pretty + prefixed compact output.
  • What did NOT change (scope boundary): JSON log payload shape and file log timestamps remain unchanged.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • Pretty console timestamps now follow local timezone formatting instead of UTC-only formatting.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Bun test runner
  • Model/provider: N/A
  • Integration/channel (if any): Logging subsystem
  • Relevant config (redacted): logging.consoleStyle=pretty

Steps

  1. Configure pretty console output.
  2. Emit subsystem logs.
  3. Compare displayed time to local timezone.

Expected

  • Console time prefix reflects local timezone clock.

Actual

  • Previously displayed UTC-derived HH:MM:SS.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: bun test src/logging/subsystem.test.ts passes; new test asserts subsystem logger calls shared local timestamp formatter.
  • Edge cases checked: pretty style + timestamp-prefix path both route through shared formatter.
  • What you did not verify: full end-to-end runtime logs on multiple timezone hosts.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert this PR commit.
  • Files/config to restore: src/logging/subsystem.ts, src/logging/subsystem.test.ts.
  • Known bad symptoms reviewers should watch for: unexpected timestamp format regressions in console output.

Risks and Mitigations

  • Risk: subtle formatting regression in console timestamp prefixes.
    • Mitigation: test coverage added to assert formatter routing and existing timestamp helper behavior remains centralized.

Route subsystem pretty/compact timestamp rendering through the shared local-time formatter so console logs honor configured timezone behavior instead of always showing UTC.

Co-authored-by: Cursor <cursoragent@cursor.com>
gumadeiras pushed a commit that referenced this pull request Mar 2, 2026
… and docs (openclaw#16761)

Add inline file attachment support for sessions_spawn (subagent runtime only):

- Schema: attachments[] (name, content, encoding, mimeType) and attachAs.mountPath hint
- Materialization: files written to .openclaw/attachments/<uuid>/ with manifest.json
- Validation: strict base64 decode, filename checks, size limits, duplicate detection
- Transcript redaction: sanitizeToolCallInputs redacts attachment content from persisted transcripts
- Lifecycle cleanup: safeRemoveAttachmentsDir with symlink-safe path containment check
- Config: tools.sessions_spawn.attachments (enabled, maxFiles, maxFileBytes, maxTotalBytes, retainOnSessionKeep)
- Registry: attachmentsDir/attachmentsRootDir/retainAttachmentsOnKeep on SubagentRunRecord
- ACP rejection: attachments rejected for runtime=acp with clear error message
- Docs: updated tools/index.md, concepts/session-tool.md, configuration-reference.md
- Tests: 85 new/updated tests across 5 test files

Fixes:
- Guard fs.rm in materialization catch block with try/catch (review concern #1)
- Remove unreachable fallback in safeRemoveAttachmentsDir (review concern openclaw#7)
- Move attachment cleanup out of retry path to avoid timing issues with announce loop

Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
Co-authored-by: napetrov <napetrov@users.noreply.github.com>
steipete pushed a commit that referenced this pull request Mar 2, 2026
… and docs (openclaw#16761)

Add inline file attachment support for sessions_spawn (subagent runtime only):

- Schema: attachments[] (name, content, encoding, mimeType) and attachAs.mountPath hint
- Materialization: files written to .openclaw/attachments/<uuid>/ with manifest.json
- Validation: strict base64 decode, filename checks, size limits, duplicate detection
- Transcript redaction: sanitizeToolCallInputs redacts attachment content from persisted transcripts
- Lifecycle cleanup: safeRemoveAttachmentsDir with symlink-safe path containment check
- Config: tools.sessions_spawn.attachments (enabled, maxFiles, maxFileBytes, maxTotalBytes, retainOnSessionKeep)
- Registry: attachmentsDir/attachmentsRootDir/retainAttachmentsOnKeep on SubagentRunRecord
- ACP rejection: attachments rejected for runtime=acp with clear error message
- Docs: updated tools/index.md, concepts/session-tool.md, configuration-reference.md
- Tests: 85 new/updated tests across 5 test files

Fixes:
- Guard fs.rm in materialization catch block with try/catch (review concern #1)
- Remove unreachable fallback in safeRemoveAttachmentsDir (review concern openclaw#7)
- Move attachment cleanup out of retry path to avoid timing issues with announce loop

Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
Co-authored-by: napetrov <napetrov@users.noreply.github.com>
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.

Bug: Console log timestamps always shown in UTC regardless of TZ env or consoleStyle setting

1 participant