GroupX 0.1.8 context, Agent memory, runtime reuse, and UI refresh - #2
Merged
Merged
Conversation
susyimes
marked this pull request as ready for review
August 13, 2026 15:50
There was a problem hiding this comment.
Pull request overview
This PR advances GroupX to a cohesive 0.1.8 release by adding runtime instance reuse (to avoid avoidable EADDRINUSE), exposing room context usage + manual compaction in the UI, and splitting per-Agent memory into explicitly curated core memory plus automatic dated memory—backed by a SQLite schema migration and updated Web/MCP/contract surfaces.
Changes:
- Add stable runtime identity (
runtimeKey) to/api/health, probe/reuse the same running instance ongroupx start, and introduce runtime discovery utilities/tests. - Split Agent memory into
core | datedwith schema v6 migration; automatically archive bounded dated memory on successful turns; addcore_memory_rememberMCP tool. - Update the Web UI (context usage meter + “压缩会话” control, Agent setup memory layering) and refresh docs/README to match structured-only transport and new memory/context model.
Reviewed changes
Copilot reviewed 50 out of 59 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web/styles.css | Adds layout/styling for composer topbar context controls and adjusts runtime progress presentation. |
| web/setup.ts | Renders Agent memory as separate core vs dated layers and parses agentMemoryType. |
| web/setup.html | Updates asset versioning and renames Agent memory copy to reflect core/dated layers. |
| web/setup.css | Styles new memory layer headings/groups in setup UI. |
| web/index.html | Moves runtime progress into composer topbar and adds context usage + manual compaction controls. |
| web/app.ts | Implements /api/context polling/rendering and manual /api/context/compact command flow. |
| tests/unit/web/server/server.test.ts | Adds coverage for /api/context and /api/context/compact REST endpoints. |
| tests/unit/storage/sqlite-store.test.ts | Validates automatic dated memory creation, bounds, and schema v6 migration behaviors. |
| tests/unit/memory/context-packet.test.ts | Updates context packet sections/schema to include agent core/dated memory and de-dupe rules. |
| tests/unit/memory/context-engine.test.ts | Adds tests for usage inspection and manual compaction retaining a recent tail of messages. |
| tests/unit/mcp/server/tools.test.ts | Adds MCP tool tests for core_memory_remember binding behavior. |
| tests/unit/mcp/server/http.test.ts | Extends MCP HTTP broker fixture to include core memory tool wiring. |
| tests/unit/contracts/web-schema.test.ts | Adds schema safety checks for compact context request and Agent memory typing rules. |
| tests/unit/contracts/messages.test.ts | Adds contract tests for room context usage + compact results and sender-field forbiddance. |
| tests/unit/broker/broker.test.ts | Tests broker single-flight + replay for explicit context compaction command. |
| tests/unit/app/start-runtime.test.ts | Adds unit tests for idempotent groupx start reuse vs conflict handling. |
| tests/unit/app/runtime-instance.test.ts | Adds tests for runtime identity key stability and runtime probe classification. |
| tests/integration/app-web-broker-api.test.ts | Integrates web broker API projection for context usage + compaction commands. |
| tests/integration/app-tool-broker-api.test.ts | Integrates tool broker API behavior for bound core-memory remember writes. |
| tests/integration/app-runtime.test.ts | Asserts runtime identity fields are present in health response. |
| src/web/server/types.ts | Extends broker/server interfaces for context usage/compaction and runtime identity. |
| src/web/server/server.ts | Adds /api/context + /api/context/compact endpoints and includes runtime identity in /api/health. |
| src/storage/types.ts | Introduces AgentMemoryType, adds agentMemoryType filtering/query fields, and terminal dated memory outputs. |
| src/storage/sqlite-store.ts | Enforces agent memory typing, adds schema support, and writes automatic dated memory on successful turns. |
| src/storage/schema.ts | Bumps schema to v6 and adds agent_memory_type column + triggers/index migration. |
| src/memory/types.ts | Adds room context usage/compaction types and splits context sections into core vs dated memory; bumps schema to 0.4. |
| src/memory/context-packet.ts | Emits [agent_core_memory]/[agent_dated_memory], prioritizes core memory, and de-dupes dated memory vs transcript. |
| src/memory/context-engine.ts | Adds room usage inspection, manual compaction retaining a recent tail, and controller interface methods. |
| src/mcp/server/tools.ts | Registers core_memory_remember MCP tool with strict contract parsing. |
| src/mcp/server/broker-api.ts | Extends broker API surface for core memory remember tool. |
| src/main.ts | Computes runtime identity at startup and passes it into the runtime/server. |
| src/core/runtime-instance.ts | Implements deterministic runtime identity hashing + parsing. |
| src/contracts/rest.ts | Adds REST schemas/contracts for context usage/compaction and Agent memory type constraints. |
| src/contracts/mcp.ts | Adds MCP schemas/contracts for core memory remember and memory search agentMemoryType filtering. |
| src/cli.ts | Adds idempotent startConfiguredRuntime flow with probing/reuse and moves CLI execution behind entry-module guard. |
| src/broker/types.ts | Extends broker dependency surface for a context controller and exposes context usage/compaction commands. |
| src/broker/broker.ts | Implements context usage + compaction command single-flight/idempotent receipts and ensures memory typing defaults. |
| src/app/web-broker-api.ts | Projects context usage/compaction through the web broker API and supports agentMemoryType queries. |
| src/app/tool-broker-api.ts | Implements coreMemoryRemember bound to the calling Agent identity and enforces agentMemoryType. |
| src/app/runtime.ts | Wires runtime identity into server health and exposes context engine as broker context controller. |
| src/app/runtime-instance.ts | Adds runtime launch description and runtime probe logic for CLI reuse/conflict detection. |
| src/app/record-mappers.ts | Extends memory record mapping to include automatic_turn and agentMemoryType. |
| README.md | Refreshes documentation for structured-only transport, context controls, memory layers, and 0.1.8 release notes. |
| package.json | Bumps version to 0.1.8 and includes demo GIF in published files list. |
| package-lock.json | Updates lockfile version metadata to 0.1.8. |
| docs/STORAGE_AND_MEMORY.md | Documents schema v6 memory typing, terminal transaction order including dated memory, and context usage/compaction semantics. |
| docs/PROTOCOL.md | Updates protocol docs for context endpoints, health identity, and core memory tool semantics. |
| docs/IMPLEMENTATION.md | Updates implementation plan and REST/tool surface list for new context + memory features. |
| docs/DECISIONS.md | Adds decisions for runtime reuse and memory layering plus context UI/command behavior. |
| docs/ACCEPTANCE_TESTS.md | Adds acceptance criteria for start reuse, context controls, and memory layering/dated memory behavior. |
| AGENTS.md | Updates product invariants to distinguish Agent core vs dated memory data classes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+276
to
+279
| function isEntryModule(): boolean { | ||
| const entry = process.argv[1]; | ||
| return entry !== undefined && import.meta.url === pathToFileURL(path.resolve(entry)).href; | ||
| } |
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 changed
Why
This brings the runtime, context engine, memory model, UI, documentation, and packaged assets into one coherent 0.1.8 release state. It also prevents repeated
groupx startcalls from surfacing an avoidableEADDRINUSEerror when the same runtime is already healthy.Validation
npm run typechecknpm test— 48 files, 485 tests passednpm run buildnpm pack --dry-run --json— package includes the 313,546-byte demo GIFgit diff --check