Repository navigation
fix(coach): the consent screen names session notes, and they arrive whole - #352
Merged
DuarteSantos8 merged 1 commit intoOct 7, 2026
Merged
Conversation
…hole The Coach's payload carries each recent session's note (cleanWorkout in api/coach/core/payload.js), but the consent screen's "Your logged training" line listed weights, reps, times, effort ratings and session lengths and never mentioned notes. It now ends "and your session notes", and the AI_COACH.md table says the same. CONSENT_VERSION goes from 1 to 2 with it, so everyone who agreed to the old wording is asked again the next time they open the Coach: the chat sends them to the intake while hasConsent() is false. Before, that redirect replayed all seven intake questions and ended in a new plan request. An athlete who already has a profile now sees only the consent step and goes back to the Coach with their answers untouched. Someone who never agreed still gets the full intake. The note itself was cut at 300 characters while the app lets it run to 500 (NOTE_MAX in frontend/src/lib/history.js). payload.js has its own NOTE_MAX = 500 now, and payload-parity.test.js pins it to the app's. Tests: CoachIntake.test.jsx gains two (35), payload.test.js one (28), payload-parity.test.js one (4); each fails against the old code. The three CoachChat test fixtures that hard-coded consent version 1 read CONSENT_VERSION instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 6, 2026
Owner
|
Merged and released in v1.3.10, thanks @kurktchiev! https://github.com/DuarteSantos8/openGym/releases/tag/v1.3.10 |
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.
The Coach's payload carries each recent session's note (
cleanWorkoutinapi/coach/core/payload.js). The consent screen's "Your logged training" line listed weights,
reps, times, effort ratings and how long sessions took, and never mentioned notes. It now ends
"…, and your session notes." The table in docs/AI_COACH.md and the comment in categories.js say
the same. Per-exercise notes are not in the payload, so the line names session notes only.
What the version bump does.
CONSENT_VERSIONgoes from 1 to 2 with the new wording.hasConsent()wants the current version, so everyone who agreed to version 1 is asked again thenext time they open the Coach, on the web or on the phone: CoachChat sends them to the intake.
Before this change, that redirect replayed all seven intake questions and ended in a new plan
request. Now an athlete who already has a profile sees only the consent step, and "I understand"
takes them back to the Coach with their answers untouched. Someone who never agreed still gets the
full intake.
The server is not part of the bump.
enqueueandexecutein api/coach/jobs.js, the weeklycadence and coach-local.js on the phone check only
consent.agreedAt. So a weekly review keepsrunning for someone who has not opened the Coach since, on the agreement they gave. Making those
four checks want the new version too would pause every weekly review until each person opens the
app, so I left it out; say if you want it.
GET /api/coach/disclosurestill returnsversion: 1.Nothing reads it, and its category list did not change.
The note was cut at 300 characters. The app lets a session note run to 500 (
NOTE_MAXinfrontend/src/lib/history.js), so a longer note reached the model cut off mid-sentence. payload.js
has its own
NOTE_MAX = 500now (the api cannot import the frontend), and payload-parity.test.jspins it to the app's.
Tests, each new one failing against the old code:
consent step and goes back to the Coach; the training line names session notes.
the app allows is bounded at 500.
NOTE_MAXvalues agree.(1) hard-coded consent version 1 in their fixtures and read
CONSENT_VERSIONnow.coach-parity.test.js (171), the three CoachSetup test files (40), and on the api side
payload-bounds (11), jobs (25), routes (6), cadence-weekly (9). check-locales.mjs and
check-source-strings.mjs pass. The consent category lines were never in the locale packs, so
there is nothing to translate here.
Overlap: #312 conflicts in payload.js (two places, around the constants it removes). #168 also
edits payload.js and coach.js but merges cleanly with this.
🤖 Generated with Claude Code