Add tests for agent-core and optimize configuration files - #3
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a root-level Vitest test suite for agent-core, updates the Vitest include paths to the new tests/ directory, and removes on-disk memory persistence so memory is kept in-process only.
Changes:
- Switched Vitest to collect tests from
tests/**and added new unit tests for tools,runLoop, andagent. - Removed
MemoryStoreJSON file persistence and updated the CLI/memoryview and documentation accordingly. - Cleaned up repo configuration/docs to reflect the new testing layout and removal of
AGENT_MEMORY_FILE.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Updates Vitest to discover tests under tests/ instead of test/. |
| tests/tools.spec.ts | Adds tests for path alias resolution + file tools behavior. |
| tests/runLoop.spec.ts | Adds run loop tests with streamLLM mocked to avoid network calls. |
| tests/agent.spec.ts | Adds agent entry-point test with runLoop mocked. |
| source/app.tsx | Removes display of memory persistence file and last error (now in-memory only). |
| README.md | Updates docs to reflect in-memory memory and the tests/ directory. |
| packages/agent-core/src/memory/memory-store.ts | Removes disk persistence; stores memory only in process. |
| .gitignore | Stops ignoring /test/ directory. |
| .env.example | Removes AGENT_MEMORY_FILE example since persistence was removed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+22
| afterEach(async () => { | ||
| process.env.AGENT_DESKTOP_DIR = previousDesktopDir; | ||
| if (tempDesktop) { | ||
| await rm(tempDesktop, { recursive: true, force: true }); | ||
| tempDesktop = undefined; | ||
| } | ||
| }); |
Comment on lines
+65
to
+66
| tests/ # 项目统一单元测试 | ||
| vitest.config.ts # Vitest 测试配置 |
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.
No description provided.