Injecting Current Time and Last Message Timestamps into DSH Models

Introduction

When chatting with models in DSH, users often say “last night,” “just now,” or “that thing I mentioned this morning.” Since the model itself has no clock, if there are no verifiable time facts in the prompt, it can only guess relative times, which often leads to incorrect answers. Skills also require the model to remember to call them, which lacks stability. The dsh-time-context introduced below follows a plugin path: it automatically writes the current local time and the time relationship with the previous user message during every prompt assembly. This allows the model to parse relative time words by comparing them against facts, rather than making assumptions out of thin air.

What is this

dsh-time-context is maintained by JessenReinhart and classified as a model reasoning-related plugin. In one sentence, its positioning is to perform Temporal grounding for DSH models—injecting dynamic runtime-context during every prompt assembly. This includes the precise current local time (date, clock time, weekday, timezone, day-part), as well as the timestamp of the user’s previous message, the relative relationship between the day and the message, and the interval from the present. It also comes with a stable system-prompt fragment to guide the model in using these facts to understand expressions like “last night,” “this morning,” or “a while ago.”

Compared to “relying solely on Skills for the model to check the time itself,” this plugin is registered in DSH’s native systemPrompt.context() / systemPrompt.section() registries. Facts automatically enter the harness’s runtime-context snapshot with every request (new snapshots overwrite old ones to avoid duplicate stacking).

Core Features

Automatically Injected Time Block

Every prompt assembly receives a block of runtime-context, which includes:

  1. Current Local Time: Date, clock, weekday, timezone, day-part.
  2. Previous User Message Info: Timestamp, day relationship with “today,” and the recency gap.
  3. Cross-session & Restart: The previous message might come from an earlier session or before an app restart; the plugin strives to maintain continuity rather than only recognizing the last sentence within the current window.

Fact Sources (Ground Truth)

The README explains that the plugin relies on the following data sources, rather than letting the model “feel” what time it is:

Source Function
agent/inbox/inserted Real-time user messages entering the agent inbox
api-session/activity(sessionId, updatedAt) Persistent timestamps for user messages
~/.dsh/time-context/state.json Local ledger retained after restarts; e.g., knowing “we chatted last night” even if opened in the morning

Command: View Current Injected Content

You can use the following command in DSH:

/time

This prints the entire time context block that is currently being written into the prompt, facilitating debugging or confirming whether the timezone and the interval of the previous message meet expectations.

Installation & Enablement

The installation instructions in the materials emphasize that the plugin is integrated into the DSH Desktop profile bundle (dsh.profile.bundles), not via a standalone one-liner like dsh plugin add …. If you have modified the plugin or profile configuration locally, you need to restart DSH Desktop to allow the bundle lines to reload.

Before use, please ensure the environment meets the package.json requirements: Node.js >= 20. The plugin version in the materials is 1.0.0, and the license is MIT.

Before installing or enabling, it is recommended to read the GitHub repository source code and license yourself. The plugin runs under the current DSH process permissions, reading and writing to ~/.dsh/time-context/state.json and subscribing to session activities. The permissions and data scope should align with your deployment strategy.

Typical Usage

  1. Ensure the dsh-time-context bundle is enabled in your Desktop profile (operate according to your current DSH Desktop configuration method).
  2. Restart DSH Desktop to make the bundle take effect.
  3. Chat with the agent normally; there is no need to manually trigger a Skill every turn, as the time block is injected automatically with requests.
  4. If the understanding of “just now / last night / this morning” in the answer seems questionable, execute /time in the session to check if the current time and the previous message related fields in the output match your expectations.

The materials do not provide additional YAML configuration examples; the behavior is primarily determined by the plugin registration and the aforementioned ground truth pipeline.

Use Cases & Notes

Who it is for

  • DSH users doing personal assistance, schedule reviews, or cross-day chat continuations who want the model to align “relative time colloquialisms” with the real clock and the interval of the previous message.
  • Scenarios where time facts are in the prompt by default, without relying on whether the model remembers to call a specific Skill.

Notes

  • Timezone and “local time” depend on the environment running DSH; in multi-machine or multi-container deployments, ensure clock and timezone configurations are consistent, otherwise the boundary of “last night” might not align with the user’s subjective perception.
  • The validity of the previous message depends on the inbox / session activity and the local ledger; if a message does not enter these pipelines, the recency might be incomplete—use /time to verify the injection results.
  • The community directory SkillHub Plugin Page is an independent site and has no official affiliation with DeepSeek / High-Flyer; star counts and broadcast data are subject to what is displayed on each site at the time (the GitHub star count in the materials is 0).

Conclusion

dsh-time-context turns “what time is it now” and “how long ago was the previous user message” into a fixed runtime-context within every request, delivered automatically to the model via the plugin registry, reducing hallucinations regarding relative time words. To further understand the classification and introduction, you can view the directory page; implementation details and bundle instructions are subject to the GitHub README.

  • Directory Page: https://www.skillhub.cn/plugins/JessenReinhart/dsh-time-context
  • GitHub: https://github.com/JessenReinhart/dsh-time-context
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye