Repository navigation
feat: add a new mode (learn mode) - #25
Merged
Merged
Conversation
Evaluate the student's response to the comprehension question
Handling failed comprehension responses
Gate pending edit based on result of answer evaluation
drek2991
force-pushed
the
myeh2/add-new-mode
branch
from
September 30, 2026 21:50
0aab13d to
d9c9857
Compare
Present comprehension questions and hand off student answers
Generate a comprehension question from proposed code changes
Add proposed change context to edit approval
Contributor
|
Needs a little more clarification on the testing happening; perhaps further integration tests and even maybe going into E2E tests. |
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.
Issue for this PR
Closes #10
Type of change
What does this PR do?
Adds a third primary agent, Learn, next to Build and Plan (Tab cycles Build → Learn → Plan; Learn is pinned green).
In Learn mode, every file edit is held until the user answers a comprehension question about the change:
edit,write, orapply_patchcall is applied, a small model call writes one question about the diff, and the user answers it in the TUI.apply_patch(used by GPT models) gets one combined question.The edit tools are the only gated path, so Learn's system reminder tells the model never to change files through bash or a subagent. This is a prompt-level guard, the same approach plan mode uses. Build and Plan are unchanged.
How did you verify your code works?
I added unit tests for each part of the feature: the Learn agent definition and its reminder, question generation (including how earlier failed attempts shape the next question and how question marks inside code are handled), answer grading (including JSON the model wraps in a code block), the retry loop, the check in the session tools, and the combined question for multi-file
apply_patchedits.bun typecheckpasses inpackages/opencodeandpackages/core, and CI is green. I also ran it locally withbun dev: I switched to Learn, asked it to edit the README, got a comprehension question first, and the edit was only written after I answered it.Screenshots / recordings
Checklist