core-agent-ide/codex-rs/protocol/src
Celia Chen 90cc4e79a2
feat: add local date/timezone to turn environment context (#12947)
## Summary

This PR includes the session's local date and timezone in the
model-visible environment context and persists that data in
`TurnContextItem`.

  ## What changed
- captures the current local date and IANA timezone when building a turn
context, with a UTC fallback if the timezone lookup fails
- includes current_date and timezone in the serialized
<environment_context> payload
- stores those fields on TurnContextItem so they survive rollout/history
handling, subagent review threads, and resume flows
- treats date/timezone changes as environment updates, so prompt caching
and context refresh logic do not silently reuse stale time context
- updates tests to validate the new environment fields without depending
on a single hardcoded environment-context string

## test

built a local build and saw it in the rollout file:
```
{"timestamp":"2026-02-26T21:39:50.737Z","type":"response_item","payload":{"type":"message","role":"user","content":[{"type":"input_text","text":"<environment_context>\n  <shell>zsh</shell>\n  <current_date>2026-02-26</current_date>\n  <timezone>America/Los_Angeles</timezone>\n</environment_context>"}]}}
```
2026-02-26 23:17:35 +00:00
..
prompts chore: migrate additional permissions to PermissionProfile (#12731) 2026-02-25 03:35:28 +00:00
account.rs add error messages for the go plan type (#10181) 2026-01-30 01:17:25 +00:00
approvals.rs feat: include sandbox config with escalation request (#12839) 2026-02-26 12:00:18 -08:00
config_types.rs Sync collaboration mode naming across Default prompt, tools, and TUI (#10666) 2026-02-04 23:03:28 -08:00
custom_prompts.rs [app-server] remove serde(skip_serializing_if = "Option::is_none") annotations (#5939) 2025-10-30 18:18:53 +00:00
dynamic_tools.rs feat(app-server, core): allow text + image content items for dynamic tool outputs (#10567) 2026-02-04 16:12:47 -08:00
items.rs Restore phase when loading from history (#12244) 2026-02-19 09:56:56 -08:00
lib.rs Revert "Add skill approval event/response (#12633)" (#12811) 2026-02-26 01:02:42 +00:00
mcp.rs feat: replace custom mcp-types crate with equivalents from rmcp (#10349) 2026-02-02 17:41:55 -08:00
message_history.rs Generate JSON schema for app-server protocol (#5063) 2025-10-20 11:45:11 -07:00
models.rs feat: include sandbox config with escalation request (#12839) 2026-02-26 12:00:18 -08:00
num_format.rs Fix execpolicy parsing for multiline quoted args (#9565) 2026-01-22 22:16:53 -08:00
openai_models.rs Use model catalog default for reasoning summary fallback (#12873) 2026-02-26 09:31:13 -08:00
parse_command.rs [app-server] remove serde(skip_serializing_if = "Option::is_none") annotations (#5939) 2025-10-30 18:18:53 +00:00
plan_tool.rs Plan mode: stream proposed plans, emit plan items, and render in TUI (#9786) 2026-01-30 18:59:30 +00:00
protocol.rs feat: add local date/timezone to turn environment context (#12947) 2026-02-26 23:17:35 +00:00
request_user_input.rs Better handling skill depdenencies on ENV VAR. (#9017) 2026-01-29 14:13:30 -05:00
thread_id.rs feat: sqlite 1 (#10004) 2026-01-28 15:29:14 +01:00
user_input.rs Enforce user input length cap (#12823) 2026-02-25 22:23:51 -08:00