Skip to content

Fix duplicate class-name announcement in seminar call flow - #160

Merged
buzz-code merged 2 commits into
mainfrom
claude/phone-classes-requirements-7u7bi7
Aug 25, 2026
Merged

buzz-code merged 2 commits into
mainfrom
claude/phone-classes-requirements-7u7bi7

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Live feedback from production calls (call log confirms it: send_message "כיתה יג 1 תשפז" immediately followed by ask_input "כיתה יג 1 תשפז, הקישי קוד מורה..."):

  • The class name was announced twice back to back on every call that resolved the class manually (once on its own, again as the prefix of the teacher-code prompt)
  • The star-escape instructions ("לבחירת כיתה אחרת הקישי כוכבית וסולמית") were read out on every teacher-code prompt, including retries after a wrong code — reported as unnecessary noise

Fix

  • Class name is now announced exactly once via SEMINAR.KLASS_CONFIRMED, regardless of whether the class was resolved by phone or entered manually
  • SEMINAR.TEACHER_CODE_PROMPT is now a bare "הקישי קוד מורה" — no repeated class name, no escape instructions
  • The * escape still works, it's just no longer announced

Not included

The second issue reported alongside this (a teacher's entered code "942" not being recognized) isn't a code bug I could confirm from here — no production DB access. Flagged separately to the user to check whether the value actually persisted.


Generated by Claude Code

Live feedback: calling from a class's own phone repeated the class
name twice back to back ("כיתה יג 1 תשפז" once as its own
announcement, then again as the prefix of the teacher-code prompt),
and the star-escape instructions were read out on every single
teacher-code prompt, including retries.

- Class name is now announced exactly once (SEMINAR.KLASS_CONFIRMED),
  regardless of whether the class was resolved by phone or entered
  manually
- SEMINAR.TEACHER_CODE_PROMPT dropped to a bare "הקישי קוד מורה" -
  no repeated class name, no escape instructions
- The star escape itself still works, just isn't announced anymore

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXGT749AjJ6BDgDqvQXQX2
Copilot AI lite review requested due to automatic review settings August 25, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Current code stops passing {klassName} interpolation values, so old DB text (or deploy-before-migration) will speak raw {klassName} placeholder.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fix Yemot seminar call flow so klass name announced once, teacher-code prompt shorter, less repeated audio noise.

Changes:

  • Send SEMINAR.KLASS_CONFIRMED from seminar flow loop, not from getKlassByInput().
  • Simplify SEMINAR.TEACHER_CODE_PROMPT usage and update tests to match new prompt text.
  • Add TypeORM migration to update default DB text for SEMINAR.TEACHER_CODE_PROMPT.
File summaries
File Description
server/src/yemot-handler.service.ts Move klass confirmation announcement, simplify teacher-code prompt call site
server/src/yemot-handler.service.test.ts Update seeded text value, assert KLASS_CONFIRMED send in phone-recognized + escape flows
server/src/migrations/1787500000000-SimplifyTeacherCodePrompt.ts Update default SEMINAR.TEACHER_CODE_PROMPT text in texts table
Review details

Suppressed comments (1)

server/src/yemot-handler.service.ts:183

  • askForInputByKey no longer receives {klassName} values. With current text interpolation (only replaces placeholders when values provided), any existing SEMINAR.TEACHER_CODE_PROMPT value that still contains {klassName} will be read out as-is. Pass { klassName: klass.name } to preserve template interpolation (even if default prompt no longer uses it).
  private async getTeacherOrEscape(): Promise<Teacher | 'ESCAPE'> {
    while (true) {
      const input = await this.askForInputByKey('SEMINAR.TEACHER_CODE_PROMPT');
      if (input === '*') return 'ESCAPE';
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/src/yemot-handler.service.ts Resolved
Per Copilot review: the default text no longer uses {klassName}, but
askForInputByKey only interpolates when values are passed - so a
per-tenant override still containing the old placeholder, or a
deploy where the app restarts before the migration runs, would read
the literal "{klassName}" out loud. Keep passing it; unused
placeholders in the current text are simply ignored.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXGT749AjJ6BDgDqvQXQX2
@buzz-code
buzz-code merged commit 8e709e2 into main Aug 25, 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.

3 participants