Skip to content

Task mode learning review refused with "unknown learning review field" on every repair attempt #744

Open

Description

@fabcd131253

Observed behavior

After a completed attempt at the default task rubik in task mode, the result page showed "Feedback unavailable" instead of a learning review. The server log shows the review model's answer refused three times (attempts 0, 1 and 2) with "unknown learning review field". The live interview itself ran normally to the end (outcome=ok), so the attempt completed but the learner got no review.

Expected behavior

A learning review with dimensions, gaps and nextActions, as docs/task-mode.md describes under "Capture and Learning review". If the model's answer has an extra field, the repair attempt should lead it to drop that field, so that one of the attempts is accepted.

Reproduction

  1. Start the server with cargo run -- web --task-mode.
  2. Open http://localhost:3000; the default task rubik opens as a guest.
  3. Choose C, accept the rules, allow the microphone and camera, calibrate, and press Start.
  4. Work through the task with Jim, then press Finish (after about 43 minutes).
  5. The result page shows "Feedback unavailable".

Observed once so far.

CodeTrial version

codetrial 0.1.0 (2e5b81b)

Environment

OS: Ubuntu 26.04 on WSL2, Windows 11
Browser: Chrome 157.0.8103.40 on Windows
Language: C
Interview loop: task mode (--task-mode), default task, guest
Problem: rubik
REACTO or STAR step: after Finish, while the learning review was generated
Reconnect: none seen on the page
Live model: gemini-3.1-flash-live-preview
Report model: gemini-3.1-flash-lite (default)

Sanitized evidence

Server log, in order; the room and session identifiers are replaced, and the token-count fields of each line are cut after the first few:

task review room=<room> attempt 0 refused: the answer was refused: unknown learning review field
gemini report room=<room> call=2 retry=0 usage prompt_tokens=18704 response_tokens=321 cached_tokens=16295 thought_tokens=0 ...
task review room=<room> attempt 1 refused: the answer was refused: unknown learning review field
gemini report room=<room> call=3 retry=0 usage prompt_tokens=18704 response_tokens=321 cached_tokens=16295 thought_tokens=0 ...
task review room=<room> attempt 2 refused: the answer was refused: unknown learning review field
codetrial live_usage room=<room> session=<session> model=gemini-3.1-flash-live-preview elapsed_s=2582 outcome=ok sockets=5 prompt_tokens=929420 response_tokens=15879 ...
  • The two report calls between the refusals have the same prompt size (18704 tokens) and the same answer size (321 tokens), so the repair attempts may be getting back the same answer each time.
  • The refusal does not name the unknown field. Naming it in the message, or logging the rejected keys, would make this easier to diagnose.

Public data confirmation

  • I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.

Activity

  1. added theissue type on Nov 16, 2026
  2. jserv commented on Nov 16, 2026

    @jserv
    Contributor

    @fabcd131253 Thanks for the log; it matches the code, and no other issue carries this error. In src/gemini/task_feedback.rs the review's repair loop differs from the interview report's in src/gemini/report_calls.rs:

    • validate in src/tasks/report.rs checks the top level and dimensions with closed, which refuses a missing key, an extra key and a non-object alike, with the one message unknown learning review field. So the log cannot say which the model returned, or which key.
    • The loop appends a fixed note before attempt 1 only, and never the refusal, so attempts 1 and 2 send the same prompt at temperature 0. Your two equal prompt_tokens=18704 lines fit that.
    • The interview report passes the failed output and each failing rule to repair_prompt and logs the bounded rules with the key; the review does neither.

    What the model returned is still unknown, and the log cannot tell us, so this stays open as the issue for that change: the refusal names the key and whether it is missing or unknown, without quoting the answer's text, and the next attempt is told that reason. If you want to take it, say so here and which of these you would change. If you see it again after that, post the line here.

  3. quill0224 commented on Nov 17, 2026

    @quill0224
    Contributor

    I read the refusal path on main (21c45b1) and will change both places named above, without echoing the rejected answer. @fabcd131253, if you already started on this, say so and I will step back.

    • validate in src/tasks/report.rs:86 gets a closed-object check of its own in place of closed(), which wraps validation::fields and stays as it is for the bank validator. The refusal says which object (the review, dimensions, or one dimension such as testingAndDiagnosis), whether it is not an object, is missing a key or has an unknown key, and which key. Missing keys are ours to name. An unknown key is named only when it is a plain identifier of at most 64 characters, and any other key is reported as unknown without its name, so no model-written text reaches the log or the next prompt. The per-dimension check at line 93 refuses with the same unnamed invalid dimension fields and gets the same treatment.
    • The repair loop in src/gemini/task_feedback.rs:43 builds each attempt's prompt from the base prompt plus the fixed note and the previous attempt's refusal reason, passed as a JSON string marked as untrusted data. Attempt 2 is then told why attempt 1 failed instead of resending attempt 1's prompt. The rejected answer itself is still never sent back, which task_feedback_exhausts_repairs_without_reusing_rejected_provider_content keeps checking.

    Tests: in tests/unit/tasks/report.rs, a missing key, an unknown identifier key, a non-identifier key whose text must not appear in the error, and a dimensions that is not an object. In tests/unit/gemini.rs, a run of three answers (a missing key, then an unknown key, then a valid review) that asserts the second request carries the first reason and the third carries the second reason and not the first. Both fail on main.

    Could you assign this to me?

  4. quill0224 commented on Nov 21, 2026

    @quill0224
    Contributor

    The change for this is ready on a branch (two commits, 311 lines, cargo test --lib -- tasks:: gemini:: passes), but the pre-push hook refuses it: ./scripts/test.sh rust on macOS 26.5 arm64 fails only three of the LiveKit tests listed in #780 (startup_outer_deadline_preserves_output_received_during_microphone_backpressure, startup_outer_deadline_rejects_absent_late_and_nonqualifying_output and a_failed_listening_note_keeps_the_cold_brief_due_and_never_arms_the_tick), which fail the same way on main, so no passing rust receipt can be written here. Should I run the gate on a Linux host and push from there, or wait for #780?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions