Skip to content

agent: event-based project-context reinjection (full/delta)#1

Open
jjcovert wants to merge 4 commits intomainfrom
feat/event-based-core-prompt-reinjection
Open

agent: event-based project-context reinjection (full/delta)#1
jjcovert wants to merge 4 commits intomainfrom
feat/event-based-core-prompt-reinjection

Conversation

@jjcovert
Copy link
Copy Markdown
Owner

Summary

Implements event-based reinjection for Project Context files to reduce repeated prompt token usage on steady-state turns.

Behavior

  • Full context injection on:
    • session start/reset
    • post-compaction boundary
    • model/provider handoff
  • Delta context injection on:
    • steady-state turns

What changed

  • Added run-level context injection controls (promptContextMode, promptContextReason, compactionCountBeforeRun)
  • Added event-based mode selection in reply-run assembly
  • Added full/delta Project Context rendering mode in system prompt builder
  • Added session prompt report metadata (contextInjectionMode, contextInjectionReason, compactionCountAtBuild, fullPromptCompactionCount)

Validation

  • corepack pnpm install --frozen-lockfile
  • corepack pnpm vitest src/auto-reply/reply/agent-runner-utils.test.ts --run
  • corepack pnpm vitest src/agents/sanitize-for-prompt.test.ts --run

Notes

Repo-wide tsc --noEmit currently reports unrelated pre-existing e2e typing failures in src/gateway/server.chat.gateway-server-chat-b.e2e.test.ts.

@jjcovert jjcovert force-pushed the feat/event-based-core-prompt-reinjection branch from 01b96b6 to 8d6b409 Compare February 19, 2026 21:12
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