Skip to content

[FEATURE]: Inject per-message timestamps as AI-visible context #15876

Closed as not planned

Description

@dawidbednarczyk

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

The AI model has no awareness of how much time passes between user messages within a conversation. The static <omo-env> block provides the session start time, but this is set once at session initialization and never updates.

This causes a concrete usability problem: when a user asks a question, leaves for hours or days, then returns and replies, the AI treats it as if seconds have passed. It says things like "wait a few minutes, I'm still working on it" when in reality the user has been gone for 3 days.

Current Workaround

Using a UserPromptSubmit hook that:

  1. Reads current timestamp
  2. Reads last message timestamp from a state file
  3. Calculates human-readable elapsed time
  4. Outputs to stdout (which gets injected as AI-visible context per the hooks spec)
  5. Updates the state file

This produces context like:

[Time Context] Current time: 2026-03-03 17:58 CET | Last user message: 3 days 2 hours ago

Proposed Native Feature

Per-message timestamps should be a first-class feature in OpenCode, not a hook workaround. Specifically:

  1. Inject current datetime into each user message's context (updating the stale <omo-env> block, or adding a separate per-message timestamp)
  2. Track elapsed time between user messages and make it visible to the AI
  3. Per-session state: Track the last AI response time as well, so the model knows if it was the one that went silent vs. the user

Why This Should Be Native

  • Every user benefits — time awareness is universally needed, not niche
  • Hook workaround is fragile — relies on file I/O, shell execution, and stdout injection semantics
  • Model can't distinguish between "user is typing slowly" (30 sec gap) and "user left for the weekend" (3 day gap) without this
  • The <omo-env> block already exists — extending it with a per-message Current time field is minimal effort

Related Issues

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 3, 2026
  2. github-actions commented on Mar 3, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature request titles must start with [FEATURE]: (e.g. [FEATURE]: Inject per-message timestamps as AI-visible context)
    • The feature request template requires a verification checkbox confirming the feature hasn't been suggested before — please make sure that is included

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. changed the title [-]Feature Request: Inject per-message timestamps as AI-visible context[/-] [+][FEATURE]: Inject per-message timestamps as AI-visible context[/+] on Mar 3, 2026
  4. github-actions commented on Mar 3, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! Everything looks good now — the title is properly formatted and the feature request is well-explained with a clear problem statement and proposed solution. The compliance flag has been removed.

  5. assigned and unassigned on Apr 26, 2026
  6. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions