feat(memory): add QdrantMemoryService implementation (Phase 1)#100
Closed
dgarson wants to merge 5 commits intodgarson/forkfrom
Closed
feat(memory): add QdrantMemoryService implementation (Phase 1)#100dgarson wants to merge 5 commits intodgarson/forkfrom
dgarson wants to merge 5 commits intodgarson/forkfrom
Conversation
- Add QdrantMemoryService with full IMemoryService interface - Wire up Qdrant client for vector storage - Add OpenAI embedding integration for Qdrant backend - Fix TypeScript errors in memory-tool.ts (null safety) - Update architecture tests to use in-memory config Phase 1 scaffolding complete: both InMemoryMemoryService and QdrantMemoryService implementations now available.
dgarson
added a commit
that referenced
this pull request
Feb 23, 2026
Resolves five issues identified in code review of feat/hitl-gateway: 1. Wire approvalManager into HitlGateway lifecycle checkAndGate now calls approvalManager.create()+register() so callers can block on approvalManager.awaitDecision(requestId). recordDecision now calls approvalManager.resolve() to unblock them. Previously the in-memory promise lifecycle was completely disconnected from the SQLite store, meaning any caller awaiting a decision would hang forever. 2. Require policy to be present for authorization in recordDecision Previously, if request.policyId was not in policiesById, the entire authorization block was silently skipped, allowing any actor to approve/deny with no role or actor checks. Now returns an explicit error when the policy is not found. 3. Fix expireRequest escalation threshold to measure from expiresAtMs afterTimeoutMs is documented as 'after the timeout' but was measured from createdAtMs, causing escalation to fire well before the request even expired. Now measures from expiresAtMs so afterTimeoutMs=30_000 means 'escalate 30s after the approval window closes'. 4. Reject decisions on requests past their expiresAtMs deadline recordDecision only checked request.status, not the clock. Without a running timeout sweep (Phase 5), status stays 'pending' past expiry, so a late approver could bypass the timeout policy. Now returns an explicit 'expired' error when the deadline has passed. 5. Fix listPendingRequests to query by status instead of post-filter The prior implementation fetched the latest 100 records and filtered in memory, silently dropping pending requests older than #100. Now queries each status (pending, escalated) explicitly with limit=500. Additional fixes: - Fix requireDifferentActor type in HitlPolicyDefinition: string|boolean -> boolean, consistent with types.approvals.ts and the Zod schema. - Fix extractShellCommandFromArgv to join all args after cmd.exe /c instead of taking only argv[idx+1], so multi-token cmd.exe commands are validated and matched correctly against rawCommand. - Add HitlEscalationSchema + maxApprovalChainDepth to zod-schema.approvals to resolve schema/type drift between runtime types and Zod validation. - Add test coverage for all fixed behaviors (31 gateway tests total). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dgarson
added a commit
that referenced
this pull request
Feb 24, 2026
Resolves five issues identified in code review of feat/hitl-gateway: 1. Wire approvalManager into HitlGateway lifecycle checkAndGate now calls approvalManager.create()+register() so callers can block on approvalManager.awaitDecision(requestId). recordDecision now calls approvalManager.resolve() to unblock them. Previously the in-memory promise lifecycle was completely disconnected from the SQLite store, meaning any caller awaiting a decision would hang forever. 2. Require policy to be present for authorization in recordDecision Previously, if request.policyId was not in policiesById, the entire authorization block was silently skipped, allowing any actor to approve/deny with no role or actor checks. Now returns an explicit error when the policy is not found. 3. Fix expireRequest escalation threshold to measure from expiresAtMs afterTimeoutMs is documented as 'after the timeout' but was measured from createdAtMs, causing escalation to fire well before the request even expired. Now measures from expiresAtMs so afterTimeoutMs=30_000 means 'escalate 30s after the approval window closes'. 4. Reject decisions on requests past their expiresAtMs deadline recordDecision only checked request.status, not the clock. Without a running timeout sweep (Phase 5), status stays 'pending' past expiry, so a late approver could bypass the timeout policy. Now returns an explicit 'expired' error when the deadline has passed. 5. Fix listPendingRequests to query by status instead of post-filter The prior implementation fetched the latest 100 records and filtered in memory, silently dropping pending requests older than #100. Now queries each status (pending, escalated) explicitly with limit=500. Additional fixes: - Fix requireDifferentActor type in HitlPolicyDefinition: string|boolean -> boolean, consistent with types.approvals.ts and the Zod schema. - Fix extractShellCommandFromArgv to join all args after cmd.exe /c instead of taking only argv[idx+1], so multi-token cmd.exe commands are validated and matched correctly against rawCommand. - Add HitlEscalationSchema + maxApprovalChainDepth to zod-schema.approvals to resolve schema/type drift between runtime types and Zod validation. - Add test coverage for all fixed behaviors (31 gateway tests total). Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
QdrantMemoryServiceimplementing fullIMemoryServiceinterfacememory-tool.tsPhase 1 Status
✅ Schema + interfaces + shadow-write wiring
✅ InMemoryMemoryService implementation
✅ QdrantMemoryService implementation
⏳ Hybrid read path + eval harness hooks (Phase 2)
⏳ Policy enforcement hardening + cutover plan (Phase 3)
Test Plan
Related: bs-tim-3 Memory Architecture 2.0