Skip to content

fix(daemon): scope dreaming triggers by agent#786

Merged
NicholaiVogel merged 1 commit into
mainfrom
Nicholai/issue-785-dream-agent-scope
May 25, 2026
Merged

fix(daemon): scope dreaming triggers by agent#786
NicholaiVogel merged 1 commit into
mainfrom
Nicholai/issue-785-dream-agent-scope

Conversation

@NicholaiVogel
Copy link
Copy Markdown
Collaborator

@NicholaiVogel NicholaiVogel commented May 25, 2026

Summary

Fixes the issue #785 agent-scope leak in dreaming triggers and the adjacent hardcoded repair fallbacks.

Changes

  • Resolve dream route agent IDs from body agentId / agent_id, query aliases, x-signet-agent-id, then daemon configured fallback.
  • Let the dreaming worker run manual triggers against a requested agent instead of only the startup default.
  • Make periodic dreaming checks scan registered and data-bearing agents serially.
  • Replace hardcoded default fallbacks in the flagged repair endpoints and scope relink-entities memory reads to the selected agent.
  • Update API docs for the dream endpoint agent contract.

Closes #785.

Type

  • fix — bug fix

Packages affected

  • @signet/daemon

Screenshots

N/A — daemon/API change only.

PR Readiness (MANDATORY)

  • Spec alignment validated (INDEX.md + dependencies.yaml)
  • Agent scoping verified on all new/changed data queries
  • Input/config validation and bounds checks added
  • Error handling and fallback paths tested (no silent swallow)
  • Security checks applied to admin/mutation endpoints
  • Docs updated for API/spec/status changes
  • Regression tests added for each bug fix
  • Lint/typecheck/tests pass locally

Migration Notes

N/A — no migrations or schema changes.

Testing

  • bun test platform/daemon/src/routes/pipeline-routes-agent.test.ts platform/daemon/src/pipeline/dreaming-worker.test.ts platform/daemon/src/pipeline/dreaming.test.ts platform/daemon/src/agent-id.test.ts
  • bunx biome check platform/daemon/src/pipeline/dreaming-worker.ts platform/daemon/src/pipeline/dreaming-worker.test.ts platform/daemon/src/routes/pipeline-routes.ts platform/daemon/src/routes/pipeline-routes-agent.test.ts platform/daemon/src/routes/repair-routes.ts platform/daemon/src/daemon.ts docs/api/knowledge-ontology.md
  • git diff --check
  • bun run --filter '@signet/daemon' build

AI disclosure

  • AI tools were used (see Assisted-by tags in commits)

Notes

bun run --filter '@signet/daemon' build:types is currently blocked by pre-existing repo-wide TypeScript issues outside this patch, including TS6059 rootDir errors for platform/core/src/migrations/* and existing test casts from Database to ReadDb/WriteDb. The PR has checklist-exception for that local typecheck caveat; no generated declaration artifacts are included.

@NicholaiVogel NicholaiVogel force-pushed the Nicholai/issue-785-dream-agent-scope branch from 5fbdd4d to 323b356 Compare May 25, 2026 12:40
@PR-Reviewer-Ant
Copy link
Copy Markdown
Collaborator

Hi @NicholaiVogel - I'm taking a look at the fixes in fix(daemon): scope dreaming triggers by agent (commit 323b3560) and will follow up shortly.

This comment is updated in place by pr-reviewer.

Copy link
Copy Markdown
Collaborator

@PR-Reviewer-Ant PR-Reviewer-Ant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata
  • Reviewer: pr-reviewer
  • Model: gpt-5.5
  • Commit: 323b3560

I did not find a correctness, security, or data-integrity issue worth flagging. The implementation matches the PR description: dream request agent resolution now honors body/query/header/fallback ordering, manual triggers run under the requested agent, periodic checks scan known/data-bearing agents, and the touched repair paths no longer fall back to a hardcoded default.

Confidence: Medium [sufficient_diff_evidence, targeted_context_included, missing_runtime_repro] - The changed route and worker code directly show the new agent resolution path and scoped dreaming calls, and the added tests cover the main body/query/fallback and manual-trigger behavior. I did not have a live daemon trace or DB fixture beyond the included tests, so confidence is medium rather than high.

@NicholaiVogel NicholaiVogel merged commit dbcdb1b into main May 25, 2026
24 checks passed
@NicholaiVogel NicholaiVogel deleted the Nicholai/issue-785-dream-agent-scope branch May 25, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dreaming: /api/dream/trigger ignores agentId, worker hardcoded to daemon-default

2 participants