Skip to content

feat(agent-core-v2): announce date changes via a system reminder - #2564

Merged
7Sageer merged 6 commits into
mainfrom
feat-date-change-reminder
Aug 4, 2026
Merged

feat(agent-core-v2): announce date changes via a system reminder#2564
7Sageer merged 6 commits into
mainfrom
feat-date-change-reminder

Conversation

@7Sageer

@7Sageer 7Sageer commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No public issue — the date part of #2316 split into its own PR; the problem is explained below.

Problem

The v2 system prompt is rendered at profile bind and after compaction. In a long-lived session the rendered date therefore goes stale after midnight, and the model keeps trusting the old date.

What changed

Split out of #2316 (skill-root watching, the skill_list reminder, plugin session-start reminders, and the cwd-change prompt refresh remain there; #2316 will be rebased once this lands).

  • Added an App-scoped hostClock os boundary (current instant + local IANA time zone) so time-sensitive domains read the clock through DI and tests stub it at the host boundary.
  • The system prompt render now yields a structured EnvironmentDisclosureSnapshot (cwd + disclosed local date) alongside the text: every registered profile exposes a structured renderSystemPrompt — registration normalizes the accepted input (AgentProfileInput: the structured renderer, the legacy text-only systemPrompt, or both) by deriving the missing entry, so a profile's text and its disclosure always come from the same render — and the builtin and plan profiles provide it directly while SYSTEM.md / ${base_prompt} file-based profiles forward the base prompt's disclosure, so reminders never parse rendered text.
  • profile.bind / config.update persist the disclosure snapshot with a monotonic renderGeneration, so a restored agent keeps the exact baseline its prompt was rendered from.
  • Context injections can carry typed disclosure metadata: providers receive their newest surviving injection (lastInjection) with its lastDisclosure and may return { content, disclosure }; the disclosure is recorded on the injected message origin and travels with undo/clear.
  • Added the date_change reminder provider (Agent scope). Its baseline prefers the disclosure on the newest surviving date_change reminder, then the persisted render-time snapshot, then an Agent-state seed for prompts that never disclose a date; each later local calendar date is announced once. The provider stays quiet while the persisted snapshot's cwd no longer matches the session cwd.

Verification:

  • agent-core-v2: 290 test files / 4539 tests passed
  • klient invalid-input matrix: 19 / 19 tests passed
  • lint:imports passed; dep-graph:lint shows no new errors
  • TypeScript typecheck: passed
  • Oxlint: no new warnings
  • State and wire manifests regenerated

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset. No changeset: experimental agent-core-v2 behavior only.
  • Ran gen-docs skill, or this PR needs no doc update. No doc update: experimental-engine behavior with no user-facing surface change.

@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 25c41aa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@25c41aa
npx https://pkg.pr.new/@moonshot-ai/kimi-code@25c41aa

commit: 25c41aa

@7Sageer
7Sageer force-pushed the feat-date-change-reminder branch from 69201d9 to e653261 Compare August 3, 2026 10:40
@7Sageer
7Sageer force-pushed the feat-date-change-reminder branch from e653261 to c8a7e43 Compare August 3, 2026 12:20
7Sageer added 5 commits August 3, 2026 22:13
…nder

# Conflicts:
#	packages/agent-core-v2/docs/state-manifest.d.ts
#	packages/agent-core-v2/docs/wire-manifest.d.ts
#	packages/agent-core-v2/src/agent/profile/profile.ts
#	packages/agent-core-v2/src/agent/profile/profileOps.ts
#	packages/agent-core-v2/src/agent/profile/profileService.ts
#	packages/agent-core-v2/test/agent/profile/binding.test.ts
#	packages/agent-core-v2/test/agent/profile/profileOps.test.ts
#	packages/agent-core-v2/test/app/config/config.test.ts
…nder

# Conflicts:
#	packages/agent-core-v2/test/agent/swarm/swarm.test.ts
@7Sageer
7Sageer merged commit aec755f into main Aug 4, 2026
14 checks passed
@7Sageer
7Sageer deleted the feat-date-change-reminder branch August 4, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant