fix(client-runtime): take shell values for fields the detail stream never delivers - #151
Merged
Merged
Conversation
…ever delivers
A thread whose goal was attached after creation showed the "Goal tasks"
right-panel surface greyed out ("only available for threads linked to a goal")
even though the goal and its task tree existed in the database.
`isThreadDetailEvent` (apps/server/src/ws.ts) deliberately delivers only the
message/activity/session event set to a thread's detail subscription, so
`thread.meta-updated` never reaches it and `detail.goalId` stays at whatever it
was when the detail snapshot was taken — null for the normal path, where a goal
is attached seconds after the thread is created. The shell subscription does
carry the update, but `mergeEnvironmentThread` took only a whitelist of fields
from the shell and `goalId` was not on it, so `activeThread.goalId` read null
for the whole session and `tasksAvailable` stayed false.
Take goalId, role, purpose and kickoffBriefPath from the shell. The whitelist
was exhaustive when written upstream (pingdotgg#2978); it drifted as the fork added
thread fields without a test or exhaustiveness check tying it to the server-side
event predicate.
`thread.kickoff-brief-set` is shell-only for the same reason, so the staged-brief
preview (ChatView reads activeThread.kickoffBriefPath) had the identical
staleness — the reducer branch claiming it "live-updates out of the
awaiting-brief state" was unreachable. Fields written only by `thread.created`
(parentThreadId, forkFromThreadId, brief) cannot go stale and stay on the
detail; a second test pins that bound so they are not over-swept.
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.
A thread whose goal was attached after creation showed the "Goal tasks"
right-panel surface greyed out ("only available for threads linked to a goal")
even though the goal and its task tree existed in the database.
isThreadDetailEvent(apps/server/src/ws.ts) deliberately delivers only themessage/activity/session event set to a thread's detail subscription, so
thread.meta-updatednever reaches it anddetail.goalIdstays at whatever itwas when the detail snapshot was taken — null for the normal path, where a goal
is attached seconds after the thread is created. The shell subscription does
carry the update, but
mergeEnvironmentThreadtook only a whitelist of fieldsfrom the shell and
goalIdwas not on it, soactiveThread.goalIdread nullfor the whole session and
tasksAvailablestayed false.Take goalId, role, purpose and kickoffBriefPath from the shell. The whitelist
was exhaustive when written upstream (pingdotgg#2978); it drifted as the fork added
thread fields without a test or exhaustiveness check tying it to the server-side
event predicate.
thread.kickoff-brief-setis shell-only for the same reason, so the staged-briefpreview (ChatView reads activeThread.kickoffBriefPath) had the identical
staleness — the reducer branch claiming it "live-updates out of the
awaiting-brief state" was unreachable. Fields written only by
thread.created(parentThreadId, forkFromThreadId, brief) cannot go stale and stay on the
detail; a second test pins that bound so they are not over-swept.