fix: generic parent ref resolution for clarification workflow#85
Merged
MaxLinCode merged 4 commits intomainfrom Apr 15, 2026
Merged
fix: generic parent ref resolution for clarification workflow#85MaxLinCode merged 4 commits intomainfrom
MaxLinCode merged 4 commits intomainfrom
Conversation
Back-pointer from clarification entity to original write target. Uses .optional().default(null) for backward compatibility with stored entities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When focus_entity_id points at an entity with parentTargetRef (e.g. a clarification), follow the ref to the actual write target. Turn-type agnostic — works for any entity kind with a parent back-pointer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Derive from resolvedOperation.targetRef when creating clarifications. Close prior open clarifications (one-open-per-workflow invariant). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
f07cd82 to
68a7ac2
Compare
ZodDefault/ZodOptional wrappers create input vs output type mismatches that surface as "two different types" errors when ConversationEntity is resolved through multiple package paths. Use plain targetRefSchema (no wrappers) and require the field explicitly. Runtime code uses `"parentTargetRef" in entity.data` to handle pre-migration entities gracefully. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
68a7ac2 to
942c2e3
Compare
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.
Summary
parentTargetReffield to clarification entity schema — back-pointer from clarification to the original write target entityresolveWriteTarget: whenfocus_entity_idpoints at an entity withparentTargetRef, follows the ref to the actual write target (turn-type agnostic)parentTargetReffromresolvedOperation.targetRefwhen creating clarifications, and closes prior open clarifications (one-open-per-workflow invariant)Supersedes PR #84 — uses entity-registry-based generic approach instead of the clarification-specific
pending_clarificationslookup.Bug fixed
When
focus_entity_idpoints at a clarification entity,applyWriteCommitdetects a "target change" and wipes accumulated fields likeday: "tomorrow". Multi-turn planning breaks: "schedule gym tomorrow" → "what time?" → "10am" loses the day.Test plan
parentTargetRefnull, object, and rejection when omitted (3 tests)resolveWriteTargettests: follows parentTargetRef, works regardless of turn type, no-op for entities without parentTargetRef, handles null parentTargetRef (4 new tests)deriveConversationReplyStatetests: populates parentTargetRef from resolvedOperation, null for new plans, closes prior open clarifications (3 new tests)🤖 Generated with Claude Code