GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — websearch: the year in the tool description invalidates every session's prompt cache at the new year · Issue #62548 · anomalyco/opencode

websearch: the year in the tool description invalidates every session's prompt cache at the new year #62548

New issue
Copy link
New issue
Copy link
Open
Open
websearch: the year in the tool description invalidates every session's prompt cache at the new year#62548
Copy link

Description

@swf-cmd
swf-cmd
opened on Nov 7, 2026
Issue body actions

Description

The websearch tool description ends with The current year is ${new Date().getFullYear()}, read once when the module loads (packages/core/src/tool/plugin/websearch.ts).

Tool definitions open every cached prompt. The first time the server starts in a new year, the tools of every session change, so each session's next request writes its whole conversation to the prompt cache again instead of reading it. A server that keeps running over the new year keeps telling the model the old year.

The date already reaches the model through the instructions (Today's date: ...), and a date change there is appended after the cached prefix, so the description doesn't need the year.

Plugins

None

OpenCode version

dev (21bf6b4)

Steps to reproduce

  1. Use a session with the websearch tool available, on Dec 31.
  2. Restart OpenCode on Jan 1 and send another prompt in that session.
  3. The tool definitions differ from the previous request, so nothing after the start of the prompt is read from the cache.

Screenshot

No response

Operating System

macOS

Terminal

Desktop app

Activity

  1. opencodejr commented on Nov 7, 2026

    @opencodejr
    opencodejrBot
    on Nov 7, 2026
    Contributor
    More actions

    Thanks for the detailed write-up!

    To restate the request: drop the year from the websearch tool description (The current year is ${new Date().getFullYear()} in packages/core/src/tool/plugin/websearch.ts), because the date already reaches the model through the instructions (Today's date: ...). That would stop the tool definitions from changing at the first restart in a new year, which rebuilds the prompt cache of every session, and a server running over New Year would no longer give the model an outdated year.

    The year was added on purpose in #13559, which accepted a cache rebuild once a year as a trade-off. So I'm treating this as an improvement rather than a bug, but the point that the instructions now carry the date makes a good case for removing it. The maintainers will consider it.

    Related:

    • fix: tweak websearch tool description date info to avoid cache busts #13559: the PR that added the year to the description
    • fix(cache): improve Anthropic prompt cache hit rate with system split and tool stability #14743: an earlier, closed PR about keeping the Anthropic prompt cache stable
    • Session warming misses the cache it is meant to keep, and warms providers that don't need it #61775: an open issue about session warming missing the prompt cache
  2. brusnyak commented on Nov 7, 2026

    @brusnyak
    brusnyak
    on Nov 7, 2026
    More actions

    Taking this. Plan: drop the hardcoded year from the websearch tool description and let the session instructions (Today's date: ...) carry it, plus a regression test that the description contains no year. I checked the other core/server tool descriptions for clock-dependent text and found none.

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

Metadata

Metadata

Assignees

No one assigned

    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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.