Skip to content

Fix follow-up generation always requesting practice#73

Merged
sfw merged 1 commit intomainfrom
sfw/fix-follow-up-intent
Mar 20, 2026
Merged

Fix follow-up generation always requesting practice#73
sfw merged 1 commit intomainfrom
sfw/fix-follow-up-intent

Conversation

@sfw
Copy link
Copy Markdown
Owner

@sfw sfw commented Mar 20, 2026

Summary

  • Root cause: _generation_request_payload() in content_workflow.py included requested_content_type but not intent in the continue action payload. The frontend's buildGenerationFormFromWorkspace() fell back to initialGenerationForm.intent = 'practice', so every follow-up request was sent as practice regardless of what the backend planned.
  • Backend fix: Add _intent_for_content_type() mapping and include intent in the payload so the backend's content type decision (explanation, worked example, practice, remediation, assessment) propagates correctly
  • Frontend fix: Change initialGenerationForm default from intent: 'practice' / requested_content_type: 'practice_problem' to intent: 'explanation' / requested_content_type: '' — a safer fallback that lets the backend decide

Test plan

  • Backend tests: 733 passed
  • Frontend tests: 289 passed
  • Backend lint clean
  • Frontend lint clean
  • Frontend production build passes
  • Manual: verify learner sees explanations and worked examples, not only practice problems

🤖 Generated with Claude Code

The backend's _generation_request_payload() set requested_content_type
in the continue action payload but never set intent. The frontend fell
back to its hardcoded default of intent='practice', so every follow-up
request asked for practice problems regardless of what the backend
planned (explanations, worked examples, etc.).

Add intent to the payload derived from content_type, and change the
frontend default from practice to explanation so the backend decides.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfw sfw merged commit 7824a21 into main Mar 20, 2026
4 checks passed
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