refactor(opencode): roll out serviceUse proxy across 14 services + tests (#28576)
This commit is contained in:
@@ -46,8 +46,8 @@ function testAgent(input: {
|
||||
|
||||
it.instance("[#26514] subagent spawned from plan mode inherits read-only restriction (edit denied)", () =>
|
||||
Effect.gen(function* () {
|
||||
const planAgent = yield* Agent.Service.use((svc) => svc.get("plan"))
|
||||
const generalAgent = yield* Agent.Service.use((svc) => svc.get("general"))
|
||||
const planAgent = yield* Agent.use.get("plan")
|
||||
const generalAgent = yield* Agent.use.get("general")
|
||||
|
||||
expect(planAgent).toBeDefined()
|
||||
expect(generalAgent).toBeDefined()
|
||||
@@ -83,8 +83,8 @@ it.instance("[#26514] explore subagent launched from plan mode also stays read-o
|
||||
// should propagate the parent **agent** permissions, not just deny edit
|
||||
// when the subagent happens to already deny it.
|
||||
Effect.gen(function* () {
|
||||
const planAgent = yield* Agent.Service.use((svc) => svc.get("plan"))
|
||||
const explore = yield* Agent.Service.use((svc) => svc.get("explore"))
|
||||
const planAgent = yield* Agent.use.get("plan")
|
||||
const explore = yield* Agent.use.get("explore")
|
||||
expect(planAgent).toBeDefined()
|
||||
expect(explore).toBeDefined()
|
||||
|
||||
@@ -108,8 +108,8 @@ it.instance(
|
||||
// be able to edit when the parent agent is `plan`.
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const planAgent = yield* Agent.Service.use((svc) => svc.get("plan"))
|
||||
const my = yield* Agent.Service.use((svc) => svc.get("my_subagent"))
|
||||
const planAgent = yield* Agent.use.get("plan")
|
||||
const my = yield* Agent.use.get("my_subagent")
|
||||
expect(planAgent).toBeDefined()
|
||||
expect(my).toBeDefined()
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ it.instance(
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
yield* Plugin.Service.use((p) => p.init())
|
||||
const agents = yield* Agent.Service.use((svc) => svc.list())
|
||||
const agents = yield* Agent.use.list()
|
||||
const added = agents.find((agent) => agent.name === PLUGIN_AGENT.name)
|
||||
expect(added?.description).toBe(PLUGIN_AGENT.description)
|
||||
expect(added?.mode).toBe(PLUGIN_AGENT.mode)
|
||||
|
||||
Reference in New Issue
Block a user