refactor(agent-core-v2): derive wire-record scope from agent scope context#1596
Merged
Conversation
…ntext
AgentWireRecordService took an ad-hoc { homedir } options object as a
constructor parameter, seeded per agent scope through SyncDescriptor
args. Since agentHomedir is join(homeDir, agentScope), the store scope
derived from it equals IAgentScopeContext.scope() — inject the scope
context instead and drop both the options parameter and the
IBootstrapService dependency.
|
commit: |
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.
Related Issue
No linked issue — internal refactor, problem explained below.
Problem
AgentWireRecordService(agent-core-v2) took an ad-hocoptions: { readonly homedir?: string } = {}bag as its first constructor parameter, passed per agent scope throughSyncDescriptorargs inagentLifecycle. In the DI × Scope architecture, per-scope configuration should flow through scope context tokens, not anonymous constructor option bags.What changed
The store scope was derived as
relative(homeDir, agentHomedir), andagentHomediris defined asjoin(homeDir, agentScope)— so the value always equalsIAgentScopeContext.scope(), which every agent scope already seeds.wireRecordService.ts: inject@IAgentScopeContextand usescopeContext.scope()as the wire-log scope; drop the options parameter and the now-unusedIBootstrapServicedependency.agentLifecycleService.ts: seedIAgentWireRecordServicewithout constructor args.test/harness/agent.ts: same seed simplification (the harness already definesIAgentScopeContextfor the agent scope).No behavior change: production resolves to the identical
sessions/<ws>/<sid>/agents/<aid>scope string, and the harness's in-memoryIAppendLogStoreignores scope/key entirely. Verified withtsc --noEmitandtest/agent/wireRecord/resume.test.ts(14 passed).Checklist
gen-changesetsskill, or this PR needs no changeset. (Internal refactor, no changeset.)gen-docsskill, or this PR needs no doc update. (No user-facing change.)