Commit 714ad90
committed
fix(harmony): discard free text between harmony channel messages
The triggered_tags grammar's sub-dispatch loop allows all tokens between
triggered tags. The model can generate trailing text after a <|end|> before
EOS (e.g. restating the answer as plain text after a tool call). These
free-text tokens arrive in EXPECT_START state, causing HarmonyError.
Add Pattern 3 to ResilientStreamableParser: silently discard any token
in EXPECT_START state that is not <|start|>. This preserves all completed
messages while ignoring inter-message garbage tokens.
Signed-off-by: Will Deines <will@garr.io>1 parent 599f35c commit 714ad90
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
0 commit comments