Skip to content

feat: make MIMI_TIMEZONE configurable via mimi_secrets.h - #179

Open
joaosouz4dev wants to merge 2 commits into
memovai:mainfrom
joaosouz4dev:feat/configurable-timezone
Open

feat: make MIMI_TIMEZONE configurable via mimi_secrets.h#179
joaosouz4dev wants to merge 2 commits into
memovai:mainfrom
joaosouz4dev:feat/configurable-timezone

Conversation

@joaosouz4dev

@joaosouz4dev joaosouz4dev commented May 21, 2026

Copy link
Copy Markdown

Summary

Today MIMI_TIMEZONE is hard-coded to US Pacific (PST8PDT,M3.2.0,M11.1.0) in mimi_config.h. Every local timestamp emitted by the firmware — session log filenames, agent context, tool output, the existing get_current_time tool, localtime_r() calls throughout — is therefore wrong by anywhere between 4 and 16 hours for users outside the US west coast. Fixing it requires editing a git-tracked file, which is easy to forget when pulling upstream and noisy in PR diffs.

This patch promotes the value to the existing build-time secrets layer:

// mimi_config.h — secret fallback + alias
#ifndef MIMI_SECRET_TIMEZONE
#define MIMI_SECRET_TIMEZONE  "PST8PDT,M3.2.0,M11.1.0"
#endif
#define MIMI_TIMEZONE         MIMI_SECRET_TIMEZONE

Set MIMI_SECRET_TIMEZONE in mimi_secrets.h (gitignored, per-device) and you're done. Leave it unset and the default keeps the prior US Pacific value, so no existing build behaves differently.

What's in the diff

  • main/mimi_config.hMIMI_SECRET_TIMEZONE with #ifndef fallback (same pattern as every other secret in the file) and MIMI_TIMEZONE aliased to it.
  • main/mimi_secrets.h.example — documented MIMI_SECRET_TIMEZONE slot with worked POSIX TZ examples for Brasília, Lisbon, London, Berlin, Tokyo, New York, plus a link to tzset(3).
  • README.md — one-paragraph pointer in the "Configure" section.

No code-path changes: every caller already includes mimi_config.h and reads MIMI_TIMEZONE, so the substitution is transparent.

Test plan

  • Default build (no mimi_secrets.h override): idf.py fullclean && idf.py build succeeds, MIMI_TIMEZONE still expands to "PST8PDT,M3.2.0,M11.1.0".
  • Override build: set MIMI_SECRET_TIMEZONE "<-03>3" in mimi_secrets.h, rebuild, flash, and confirm localtime_r() output (e.g. via get_current_time tool or any session log) matches local wall-clock time in São Paulo.
  • No new warnings from the preprocessor on either path.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added per-device timezone customization. Devices can now be configured with custom POSIX TZ strings, enabling flexible timezone settings tailored to regional requirements instead of the default Pacific timezone.
  • Documentation

    • Added detailed timezone configuration guidance including accepted TZ formats and reference documentation.

Review Change Stack

Today the timezone is hard-coded to US Pacific in mimi_config.h, which
means every local timestamp emitted by the firmware (session logs,
agent context, tool output, etc.) is wrong for any user outside the
US west coast. Changing it requires editing a tracked file and is
easy to forget when pulling upstream.

This patch adds MIMI_SECRET_TIMEZONE alongside the other build-time
secrets so it can be set per-device in mimi_secrets.h (which is
gitignored). MIMI_TIMEZONE is redefined to MIMI_SECRET_TIMEZONE and
the secret defaults to "PST8PDT,M3.2.0,M11.1.0" — identical to the
prior value, so existing setups behave exactly the same.

  main/mimi_config.h           secret fallback + alias
  main/mimi_secrets.h.example  documented secret with regional samples
  README.md                    pointer to the new knob
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 66005ae3-e0b6-4c9a-a0bd-5747cfac79da

📥 Commits

Reviewing files that changed from the base of the PR and between bb10ea0 and 7929b21.

📒 Files selected for processing (3)
  • README.md
  • main/mimi_config.h
  • main/mimi_secrets.h.example

📝 Walkthrough

Walkthrough

This PR adds a new timezone configuration mechanism that enables per-device customization via secrets. The changes introduce MIMI_SECRET_TIMEZONE as a build-time macro and refactor MIMI_TIMEZONE to use it, while documenting the feature in both the example secrets file and the README with POSIX TZ format guidance.

Changes

Timezone configuration override

Layer / File(s) Summary
Timezone configuration override mechanism
main/mimi_config.h
MIMI_SECRET_TIMEZONE is added with a default POSIX timezone string and MIMI_TIMEZONE is updated to use MIMI_SECRET_TIMEZONE instead of a hardcoded value, enabling customization per device via mimi_secrets.h.
Secrets example and user documentation
main/mimi_secrets.h.example, README.md
The example secrets file documents MIMI_SECRET_TIMEZONE with POSIX TZ format examples and reference guidance, and the README is updated to explain the new timezone configuration option.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Timezones now bend to our will,
A secret to shift, device to device,
From PST to wherever you're still—
Configuration's the sweetest spice!
hop hop 🌍

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making MIMI_TIMEZONE configurable via mimi_secrets.h, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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