Skip to content

fix(runtime): thread semantic topics into local daemon - #657

Merged
delete-cloud merged 1 commit into
mainfrom
fix/local-daemon-semantic-topic-store
Jun 30, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/local-daemon-semantic-topic-store

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Thread semantic_topic_store_factory into LocalDaemonSessionRuntimeProvider so local-daemon runtime rebuilds receive the durable TopicStore.
  • Preserve the existing default None behavior for direct provider construction.
  • Add regression tests for both direct provider construction and the production LocalDaemonRuntimePreparationService.prepare_runtime path.

Root Cause

On o6n, local-daemon sessions rebuilt runtime via LocalDaemonSessionRuntimeProvider.prepare_runtime, but that path did not pass semantic_topic_store into create_agent_for_session. SemanticMemoryPlugin therefore used _NoopTopicStore, semantic topic hits could not be rehydrated, and KB defer did not trigger even though the semantic index and planner were healthy.

Verification

  • uv run pytest tests/coding_agent/test_local_daemon_executor.py tests/coding_agent/test_runtime_preparation.py tests/coding_agent/test_memory_switch.py -q -> 60 passed
  • uv run ruff format --check src/coding_agent/executors/local_daemon.py src/coding_agent/runs/runtime_preparation.py tests/coding_agent/test_local_daemon_executor.py tests/coding_agent/test_runtime_preparation.py
  • git diff --check
  • Local read-only subagent review after fix: no P1/P2 findings

Summary by CodeRabbit

  • New Features

    • Added support for optionally wiring a semantic topic store into prepared runtime sessions.
    • Runtime setup now passes this store through consistently when creating agents.
  • Tests

    • Added coverage to verify the semantic topic store is correctly threaded through runtime preparation and session creation.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 989df887-3442-41a6-8236-1a7ae4187506

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a SemanticTopicStoreFactory type alias and a semantic_topic_store_factory field (defaulting to lambda: None) to LocalDaemonSessionRuntimeProvider. The factory is invoked during prepare_runtime to pass semantic_topic_store to create_agent_for_session. LocalDaemonRuntimePreparationService is updated to forward its own factory when constructing the provider. Two new tests verify the wiring.

Changes

Semantic Topic Store Plumbing

Layer / File(s) Summary
Type alias, field, and prepare_runtime wiring
coding-agent/src/coding_agent/executors/local_daemon.py, coding-agent/src/coding_agent/runs/runtime_preparation.py
SemanticTopicStoreFactory callable alias added; semantic_topic_store_factory field added to LocalDaemonSessionRuntimeProvider (default lambda: None); prepare_runtime calls the factory and passes the result as semantic_topic_store; LocalDaemonRuntimePreparationService.prepare_runtime forwards semantic_topic_store_factory to the provider constructor.
Tests for semantic_topic_store threading
coding-agent/tests/coding_agent/test_local_daemon_executor.py, coding-agent/tests/coding_agent/test_runtime_preparation.py
Two new async tests assert that a sentinel returned by semantic_topic_store_factory reaches create_agent_for_session as semantic_topic_store.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • delete-cloud/Coding-Agent-Loop#453: Introduced and centralized LocalDaemonSessionRuntimeProvider, which this PR directly extends with the semantic_topic_store_factory field.
  • delete-cloud/Coding-Agent-Loop#623: Propagates semantic_topic_store into SemanticMemoryPlugin in the agent creation path that this PR now supplies the store to.
  • delete-cloud/Coding-Agent-Loop#634: Introduces the same semantic_topic_store_factory pattern in checkpoint restore flows, directly parallel to this PR's runtime preparation wiring.

Poem

🐇 A factory returns a store,
Threaded through the runtime door.
Sentinel passed, assertion done,
Semantic topics—wired and won!
Hops complete, the plumbing's set ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: wiring semantic topics into the local daemon runtime path.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/local-daemon-semantic-topic-store

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@delete-cloud
delete-cloud marked this pull request as ready for review June 30, 2026 05:30
@delete-cloud

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@delete-cloud
delete-cloud merged commit 0aea889 into main Jun 30, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the fix/local-daemon-semantic-topic-store branch June 30, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant