From research #194
Overview
Implement a low-risk fix for stale orchestrator prompt reuse across /new on topic-bound sessions. The working diagnosis is that prompt precedence alone is not the primary bug. The likely failing layer is fresh-session lifecycle or bootstrap artifact reuse for the same topic-bound orchestrator session key. The implementation should ensure that a fresh /new rebuilds orchestrator bootstrap context from current disk state, resolves exactly one prompt source with winner-takes-all precedence, and never serves stale injected orchestrator.md material from a previous session state.
Use the prior #190 implementation lane as reference where helpful, especially for real chat/topic session-key targeting and project/topic-aware orchestrator prompt resolution, but validate against the current live failure shape before landing.
Implementation Checklist
Phase 1: Reproduce and instrument the real failure path (~1 day)
Phase 2: Implement deterministic fresh-session bootstrap behavior (~1.5 days)
Phase 3: Regression tests and cleanup (~1 day)
Dependencies & Blockers
- The exact
/new lifecycle may live partly outside the currently inspected DevClaw plugin code, so the developer may need to touch the gateway/session lifecycle layer in addition to lib/dispatch/bootstrap-hook.ts.
- The reverted commit history around
b187665b4d563c040cbf685622b4d10836c68a1d should be used carefully as reference, but the implementation must be validated against the stronger stale-session evidence, not just filename presence.
- If the real stale behavior is confirmed in OpenClaw core rather than DevClaw prompt resolution, the fix should be made at that lifecycle boundary instead of papering over it in the loader.
Estimated Total: 3-4 days
From research #194
Overview
Implement a low-risk fix for stale orchestrator prompt reuse across
/newon topic-bound sessions. The working diagnosis is that prompt precedence alone is not the primary bug. The likely failing layer is fresh-session lifecycle or bootstrap artifact reuse for the same topic-bound orchestrator session key. The implementation should ensure that a fresh/newrebuilds orchestrator bootstrap context from current disk state, resolves exactly one prompt source with winner-takes-all precedence, and never serves stale injectedorchestrator.mdmaterial from a previous session state.Use the prior
#190implementation lane as reference where helpful, especially for real chat/topic session-key targeting and project/topic-aware orchestrator prompt resolution, but validate against the current live failure shape before landing.Implementation Checklist
Phase 1: Reproduce and instrument the real failure path (~1 day)
/newlifecycle path used for orchestrator sessions and document whether it deletes/recreates the target session or only clears conversational history/state.sessionKey, resolved project/topic scope, resolved source path, and a short content fingerprint or semantic marker.orchestrator.mdis rebuilt, replaced, or reused when/newtargets the same topic-bound session key.wasps / fire hullcracker→ticks / fire stitcher→ remove project prompt) and confirm exactly which layer goes stale.Phase 2: Implement deterministic fresh-session bootstrap behavior (~1.5 days)
agent:<id>:mainassumptions.devclaw/projects/<project>/prompts/orchestrator.md,devclaw/prompts/orchestrator.md, and package default, with no layering or merging./newpath so a new session on an existing topic-bound logical key discards old bootstrap material before first turn, either by deleting/recreating the session object or by an explicit full rebootstrap step that replaces prior synthetic artifacts atomically.orchestrator.mdentry is overwritten from current disk resolution, and stale content cannot survive if the previously winning file is edited or removed.Phase 3: Regression tests and cleanup (~1 day)
lib/dispatch/bootstrap-hook.test.tsand/orlib/services/bootstrap.e2e.test.ts./new.Dependencies & Blockers
/newlifecycle may live partly outside the currently inspected DevClaw plugin code, so the developer may need to touch the gateway/session lifecycle layer in addition tolib/dispatch/bootstrap-hook.ts.b187665b4d563c040cbf685622b4d10836c68a1dshould be used carefully as reference, but the implementation must be validated against the stronger stale-session evidence, not just filename presence.Estimated Total: 3-4 days