# The first head comment turn omitted the comment. This run preserved it exactly.
import pathlib,subprocess,json
root=pathlib.Path(__file__).parent
cfg=json.loads((root/'after-workspace.json').read_text());w=cfg['workspace']
for args in [['git','checkout','-b','after-comment-exact','origin/main'],['git','commit','--allow-empty','-m','Demonstrate commented heredoc text'],['git','push','-u','origin','after-comment-exact']]:
 subprocess.run(args,cwd=w,capture_output=True,text=True,check=True)
prompt='This is a shell-parser reproduction. The comment on the first line is essential. Use one bash tool call with the command EXACTLY as shown between START and END, including the comment and literal newline. Do not omit, simplify, or reformat any line. Do not call T3 tools or link an MR. Reply only Done.\nSTART\n# <<EOF\nglab mr create --fill --yes\ntrue\nEND'
r=subprocess.run(['node','apps/server/src/bin.ts','thread','start',w,prompt,'--title','Commented heredoc proof','--provider','opencode','--model','openai/gpt-6-luna','--wait','--json','--base-dir',cfg['home']],cwd=cfg['checkout'],capture_output=True,text=True,check=True)
(root/'after-comment-exact.json').write_text(r.stdout)
