Repository navigation
LOU-W4, LOU-W7: sessions for createAgent; AGENTS.md auto-loading - #59
Merged
Merged
Conversation
W4: agent.session() returns an AgentSession that owns the transcript and
passes it to the executor on each send (no checkpoint/resume involved).
MemorySessionStore (default) and FileSessionStore (atomic write, id
validation). Sends are serialized; failed or aborted sends leave the
transcript unchanged; stored transcripts are trimmed to a provider-valid
prefix.
W7: loadProjectInstructions() walks up to .git/stopAt and returns the nearest
AGENTS.md/CLAUDE.md (size-capped); createAgent({ projectInstructions }) is an
opt-in that appends it under a heading.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
agent.session({ id?, store? })returns anAgentSession(id,send(input, { signal }),messages,load(),clear()).SessionStoreinterface withMemorySessionStore(default) andFileSessionStore(dir)(one JSON file per session, temp file + rename, id must match^[A-Za-z0-9_-]{1,128}$).loadProjectInstructions({ cwd?, files?, stopAt?, maxChars? })(exported from the root) and opt-increateAgent({ projectInstructions: true | { cwd, files } }), appended under## Project instructions (from AGENTS.md).docs/sessions.md, "Project instructions" section indocs/configuration.md, README bullets + session snippet, regeneratedllms.txt/llms-full.txt.Why
send()was single-turn, and nothing gave users multi-turn memory or the repo's own AGENTS.md. Both are opt-in additions.How
[...history, user]as the existinginput: Message[]ofAgentExecutor.execute, then storesresult.messagesminus the system message. No executor change; no checkpoint/resume use (LOU-U8 untouched).createAgent.tsedits are additive: the executor call is pulled into a localrunhelper thatsendand sessions share.How verified
Run on the result of merging
origin/mainat b5cd5f5 (LOU-X6):npx tsc --noEmit: cleannpm run lint: 0 errors (433 warnings, none in new files)npm run test:coverage: Test Files 115 passed; Tests 1625 passed, 4 skippednpm run fallow: exit 0npm run test:types: no errorsnpm run docs:verify-snippets: all 56 snippets type-check against src/; 6 also run cleanlynpm run docs:llms:check: exit 0Notes for reviewer
AgentSessionbecauseSessionis already exported fromsrc/data/models.ts.agent.streamdoes not exist on main yet, sosession.stream()is not added; add it whenagent.streamlands.loadProjectInstructionsis synchronous (it runs once inside the synccreateAgent). Empty/whitespace-only files are skipped.session.messagesis empty for a resumed session untilload()or the firstsend()completes.🤖 Generated with Claude Code