mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Three coordinated things:
1. Resolve the committed upstream/main merge conflicts. 94 files were
sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
by keeping HEAD everywhere — 540 conflict blocks.
2. Rewrite remaining OpenClaw text refs.
OPENCLAW → HANZO_BOT
OpenClaw → HanzoBot (PascalCase type identifiers)
openclaw → bot (codebase convention — botToken,
botUsername etc.; avoids invalid
hyphenated JS identifiers)
openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z] (compound)
ai.openclaw.x → ai.hanzo.bot.x (JVM package path)
3. Delete or rename openclaw-named file paths (116 of them). Dead
duplicates with a Bot-named canonical from the partial migration:
deleted. Otherwise renamed.
ai/openclaw/** → deleted (ai/hanzo/bot/** canonical)
Sources/OpenClaw*/ → deleted (Sources/Bot* canonical)
Tests/OpenClawIPCTests/ → deleted (Tests/BotIPCTests canonical)
OpenClawKit/ → deleted (BotKit canonical)
openclaw-tools.*.ts → deleted (bot-tools.*.ts canonical)
openclaw-root.ts etc. → deleted (bot-root.ts canonical)
types.openclaw.ts → deleted (types.bot.ts canonical)
extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
docs/start/openclaw.md → renamed hanzo-bot.md (+ zh-CN)
docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
scripts/.../openclaw-* → deleted (bot/hanzo-bot parallels)
openclaw.mjs → deleted (hanzo-bot.mjs is package.bin)
Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).
Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.
The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.
Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
3.7 KiB
3.7 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
信封、提示词、工具和连接器中的日期与时间处理 | 日期与时间 |
|
日期与时间
HanzoBot 默认使用主机本地时间作为传输时间戳,并且仅在系统提示词中使用用户时区。
提供商时间戳会被保留,因此工具保持其原生语义(当前时间可通过 session_status 获取)。
消息信封(默认为本地时间)
入站消息会附带一个时间戳(分钟精度):
[Provider ... 2026-01-05 16:26 PST] message text
此信封时间戳默认为主机本地时间,与提供商时区无关。
你可以覆盖此行为:
{
agents: {
defaults: {
envelopeTimezone: "local", // "utc" | "local" | "user" | IANA 时区
envelopeTimestamp: "on", // "on" | "off"
envelopeElapsed: "on", // "on" | "off"
},
},
}
envelopeTimezone: "utc"使用 UTC。envelopeTimezone: "local"使用主机时区。envelopeTimezone: "user"使用agents.defaults.userTimezone(回退到主机时区)。- 使用显式 IANA 时区(例如
"America/Chicago")指定固定时区。 envelopeTimestamp: "off"从信封头中移除绝对时间戳。envelopeElapsed: "off"移除已用时间后缀(+2m样式)。
示例
本地时间(默认):
[WhatsApp +1555 2026-01-18 00:19 PST] hello
用户时区:
[WhatsApp +1555 2026-01-18 00:19 CST] hello
启用已用时间:
[WhatsApp +1555 +30s 2026-01-18T05:19Z] follow-up
系统提示词:当前日期与时间
如果已知用户时区,系统提示词会包含一个专门的当前日期与时间部分,其中仅包含时区(不含时钟/时间格式),以保持提示词缓存的稳定性:
Time zone: America/Chicago
当智能体需要获取当前时间时,请使用 session_status 工具;状态卡中包含时间戳行。
系统事件行(默认为本地时间)
插入到智能体上下文中的排队系统事件会带有时间戳前缀,使用与消息信封相同的时区选择(默认:主机本地时间)。
System: [2026-01-12 12:19:17 PST] Model switched.
配置用户时区和格式
{
agents: {
defaults: {
userTimezone: "America/Chicago",
timeFormat: "auto", // auto | 12 | 24
},
},
}
userTimezone设置提示词上下文中的用户本地时区。timeFormat控制提示词中的 12 小时/24 小时显示格式。auto跟随操作系统偏好设置。
时间格式检测(auto)
当 timeFormat: "auto" 时,HanzoBot 会检查操作系统偏好设置(macOS/Windows),并回退到区域格式。检测到的值会按进程缓存,以避免重复的系统调用。
工具载荷 + 连接器(原始提供商时间 + 标准化字段)
渠道工具返回提供商原生时间戳,并添加标准化字段以保持一致性:
timestampMs:纪元毫秒数(UTC)timestampUtc:ISO 8601 UTC 字符串
原始提供商字段会被保留,不会丢失任何数据。
- Slack:来自 API 的类纪元字符串
- Discord:UTC ISO 时间戳
- Telegram/WhatsApp:提供商特定的数字/ISO 时间戳
如果需要本地时间,请使用已知时区在下游进行转换。