fix: critical TRL trainer bugs — wrong prompt, ignored task_ids, DSL parsing#236
Merged
Conversation
…parsing Three bugs reported from client testing the TRL path: 1. Garbage output: TRL used a JSON system prompt but the model was SFT'd on DSL format (Thought/Action). Now imports SYSTEM_PROMPT from the standalone trainer so both paths use the identical prompt. 2. task_ids ignored: trl_wrapper loaded ALL tasks from task_dir into the TRL dataset, ignoring TrainingConfig.task_ids. Now filters task_configs by task_ids when specified (matching by id or name). 3. parse_action_json only handled JSON: constrained decoding produces DSL (CLICK(x=0.5, y=0.3)), but the parser only tried JSON. Now falls back to DSL regex parsing, keeping fractional coordinates for pixel_action. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lth check - Add system_prompt parameter to make_waa_rollout_func (default = DSL prompt from standalone trainer). Users can override if they SFT on a different format. - Log the system prompt at startup for debugging. - Make Outlines failure loud: ImportError raises instead of silent fallback. Other failures log CRITICAL warning. - Fix health check to skip mock adapters (unittest.mock.MagicMock). - Fix test mocks to accept **kwargs for stuck_threshold. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 29, 2026
abrichr
added a commit
that referenced
this pull request
Mar 29, 2026
- Add openadapt-types>=0.1.0 to core dependencies (canonical action schema for the OpenAdapt ecosystem — Pydantic v2, lightweight) - Add _AgentOutput Pydantic model for future Outlines JSON schema constrained decoding (currently unused — default is DSL regex) - Does NOT change the system prompt (DSL format, matching #236 fix) The _AgentOutput model enables switching to outlines.json(model, schema) once models are SFT'd on JSON format. For now, DSL regex remains default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
abrichr
added a commit
that referenced
this pull request
Mar 29, 2026
- Add openadapt-types>=0.1.0 to core dependencies (canonical action schema for the OpenAdapt ecosystem — Pydantic v2, lightweight) - Add _AgentOutput Pydantic model for future Outlines JSON schema constrained decoding (currently unused — default is DSL regex) - Does NOT change the system prompt (DSL format, matching #236 fix) The _AgentOutput model enables switching to outlines.json(model, schema) once models are SFT'd on JSON format. For now, DSL regex remains default. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
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.
Summary
Three critical bugs reported from client testing the TRL path on a live GPU:
Thought: # # # # # # #): TRL used a JSON system prompt but the model (Qwen2.5-VL-7B) was SFT'd on the DSL format. Now importsSYSTEM_PROMPTfrom the standalone trainer so both paths use the identical prompt.trl_wrapperloaded ALL tasks fromtask_dir, ignoringTrainingConfig.task_ids. Now filters bytask_idswhen specified.parse_action_jsononly handled JSON, but constrained decoding produces DSL (CLICK(x=0.5, y=0.3)). Now falls back to DSL regex with fractional coordinate preservation.Root cause analysis
The standalone trainer produces valid output because it uses
SYSTEM_PROMPTfromprompt.py— the exact same prompt format the base model was SFT'd on. The TRL wrapper used a completely different JSON-format prompt that the model had never seen during training. This is equivalent to asking someone a question in a language they don't speak.Test plan
parse_action_jsonhandles JSON input (existing tests)parse_action_jsonhandles DSL input (falls through to regex)🤖 Generated with Claude Code