[Enhancement] - End of Message Response#311
Conversation
|
@claude pr-check |
This comment was marked as outdated.
This comment was marked as outdated.
…eamHelper to use onDone callback and Promise<void>; Fixed double error message in Letter.tsx
…cks; tighten system prompt to enforce generate_letter tool usage
…oppose to an AI generated chunk
fdaf3af to
b3f6902
Compare
|
@claude, pr-check, I've just finished resolving a merge conflict |
|
Claude finished @leekahung's task in 1m 35s —— View job PR Review: End of Message Response
The PR is clean and well-structured. The core fix — passing custom tool chunks through directly instead of wrapping them in A few observations: Minor issues
What's solid
None of the above are blockers. Good to merge after addressing the log message if desired. |
|
@claude pr-check |
|
Claude finished @leekahung's task in 1m 35s —— View job PR Review: End of Message Response
This is a clean PR. The previous review's two flagged issues (log message wording, test placement) have both been addressed. Here's the full fresh pass: What's fixed
Minor observations (non-blocking)
What's solid
No blockers. Good to merge. |
| yield NonStandardContentBlock( | ||
| type="non_standard", value=cast(Dict[str, Any], chunk) | ||
| ) | ||
| yield cast(ContentBlock, chunk) |
There was a problem hiding this comment.
I don't think this is necessary. This code is working, unless you're saying that it breaks something else. Plus it's not clear that this type-cast makes sense.
There was a problem hiding this comment.
Think some of the behavior that broke the build came pre-merge conflict resolution.
Patched to the code to use the destructure pattern and included a few debug loggers to better show what might be happening in development, I'll see what I can revert
| case "non_standard": | ||
| inner: Dict[str, Any] = content_block["value"] | ||
| match inner.get("type"): | ||
| case "letter": | ||
| yield LetterChunk(content=inner["content"]) | ||
| case _: | ||
| current_app.logger.warning( | ||
| f"Unhandled non_standard block value type: {inner.get('type')}" | ||
| ) | ||
| case "letter": | ||
| yield LetterChunk(content=content_block["content"]) |
There was a problem hiding this comment.
I think we'll need this destructuring pattern when we use a similar approach for other tools (e.g. citation type).
There was a problem hiding this comment.
I'll see if I can incorporate this pattern to capture content blocks coming from tools.
… tool chunks in NonStandardContentBlock; Moved letter constraint to tool docstring; Trimmed Architecture.md code block
|
@claude pr-check |
|
Claude finished @leekahung's task in 1m 55s —— View job PR Review: End of Message Response
All of Addressed feedback
What's solid
One minor observation (non-blocking)
No blockers. The PR is in good shape to merge. |
…relevant frontend files for end of stream
yangm2
left a comment
There was a problem hiding this comment.
Python looks good. Someone else should review the frontend.
What type of PR is this? (check all applicable)
Description
This PR adds a done chunk to signal stream completion. The backend appends {"type": "done"} after all content blocks, and the frontend uses it to trigger the onDone callback rather than relying on the stream closing.
Also fixes the letter panel never appearing: custom stream chunks from generate_letter were being wrapped as NonStandardContentBlock(type="non_standard") instead of passed through directly, so letter content was silently dropped before reaching the frontend.
Another bug fix was the Generate Letter button not showing the message window. The main cause was the route for the Link set in InitializationForm was set to "letter" instead of "/letter", causing the route to jump to
/chat/letterinstead of/letter, the proper route for Generate Letter. Included a new unit test to cover the Generate Letter bug.Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note on the devices and browsers this has been tested on, as well as any relevant images for UI changes.
No visual changes, but the plumbing for the new chunk for "Done" should appear in our backend debugging logs following the other response chunks and at the very end.
Added/updated tests?
Documentation
Architecture.mdhas been updated[optional] Are there any post deployment tasks we need to perform?