Skip to content

Commit 594a6d0

Browse files
Nyako Shigurecodex
andauthored
🐛 fix: streamline rendered action hints (#46)
Co-authored-by: Codex <codex@openai.com>
1 parent 9d15a31 commit 594a6d0

4 files changed

Lines changed: 15 additions & 37 deletions

File tree

skills/github-conversation/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ GitHub stores the body text exactly as sent.
2929
1. Do not write multi-paragraph bodies as literal escape sequences such as `\n` or `\n\n`.
3030
2. If you send `--body 'line1\n\nline2'`, GitHub may store the backslashes literally, and the rendered review/comment will show `\n\n`.
3131
3. Use `--body` only for short single-paragraph text.
32-
4. For quotes, bullets, code fences, or multiple paragraphs, prefer `--body-file` with a file or `-` on standard input.
33-
5. For review suggestions that span multiple lines, prefer `--suggestion-file`.
32+
4. In the command patterns documented by this skill, every write action that accepts `--body` also has a `--body-file` form.
33+
5. For quotes, bullets, code fences, or multiple paragraphs, prefer `--body-file` with a file or `-` on standard input.
34+
6. For review suggestions that span multiple lines, prefer `--suggestion-file`.
3435

3536
Safe patterns:
3637

src/gh_llm/github_api.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2990,12 +2990,7 @@ def _render_review_thread_block(
29902990
resolve_cmd = display_command_with(f"pr thread-resolve {thread_id} --pr {ref.number} --repo {ref.owner}/{ref.name}")
29912991
lines.append(f" ◌ thread_id: {thread_id}")
29922992
lines.append(" ⌨ reply_body: '<reply>'")
2993-
lines.append(" ⌨ reply_body_file: '<reply.md>'")
29942993
lines.append(f" ⏎ Reply via {display_command()}: `{reply_cmd}`")
2995-
lines.append(
2996-
" ⏎ Multi-line reply via "
2997-
+ f"{display_command()}: `{display_command_with(f'pr thread-reply {thread_id} --body-file <reply.md> --pr {ref.number} --repo {ref.owner}/{ref.name}')}`"
2998-
)
29992994
if is_resolved:
30002995
lines.append(f" ⏎ Unresolve via {display_command()}: `{unresolve_cmd}`")
30012996
else:
@@ -3161,14 +3156,9 @@ def _render_review_comment_block(
31613156
edit_cmd = display_command_with(
31623157
f"pr comment-edit {comment_id} --body '<comment_body>' --pr {ref.number} --repo {ref.owner}/{ref.name}"
31633158
)
3164-
edit_file_cmd = display_command_with(
3165-
f"pr comment-edit {comment_id} --body-file <comment.md> --pr {ref.number} --repo {ref.owner}/{ref.name}"
3166-
)
31673159
lines.append(f" ◌ comment_id: {comment_id}")
31683160
lines.append(" ⌨ comment_body: '<comment_body>'")
3169-
lines.append(" ⌨ comment_body_file: '<comment.md>'")
31703161
lines.append(f" ⏎ Edit comment via {display_command()}: `{edit_cmd}`")
3171-
lines.append(f" ⏎ Multi-line edit via {display_command()}: `{edit_file_cmd}`")
31723162

31733163
if not body and not diff_hunk:
31743164
lines.append(" (empty review comment)")

src/gh_llm/render.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ def render_pr_actions(context: TimelineContext, *, include_diff: bool = True, in
161161
[
162162
"⌨ comment_body: '<comment_body>'",
163163
f"⏎ Comment via gh: `gh pr comment {context.number} --repo {repo} --body '<comment_body>'`",
164-
"⌨ comment_body_file: '<path-or->'",
165-
f"⏎ Multi-line comment via gh: `gh pr comment {context.number} --repo {repo} --body-file <path-or->`",
166164
*close_or_reopen_lines,
167165
"⌨ labels_csv: '<label1>,<label2>'",
168166
f"⏎ Add labels via gh: `gh pr edit {context.number} --repo {repo} --add-label '<label1>,<label2>'`",
@@ -188,8 +186,6 @@ def render_issue_actions(context: TimelineContext) -> list[str]:
188186
"## Actions",
189187
"⌨ comment_body: '<comment_body>'",
190188
f"⏎ Comment via gh: `gh issue comment {context.number} --repo {repo} --body '<comment_body>'`",
191-
"⌨ comment_body_file: '<path-or->'",
192-
f"⏎ Multi-line comment via gh: `gh issue comment {context.number} --repo {repo} --body-file <path-or->`",
193189
*close_or_reopen_lines,
194190
"⌨ labels_csv: '<label1>,<label2>'",
195191
f"⏎ Add labels via gh: `gh issue edit {context.number} --repo {repo} --add-label '<label1>,<label2>'`",
@@ -424,14 +420,9 @@ def _render_item(index: int, event: TimelineEvent, context: TimelineContext, com
424420
edit_cmd = display_command_with(
425421
f"{command_group} comment-edit {event.editable_comment_id} --body '<comment_body>' --{selector_name} {context.number} --repo {context.owner}/{context.name}"
426422
)
427-
edit_file_cmd = display_command_with(
428-
f"{command_group} comment-edit {event.editable_comment_id} --body-file <comment.md> --{selector_name} {context.number} --repo {context.owner}/{context.name}"
429-
)
430423
lines.append(f" ◌ comment_id: {event.editable_comment_id}")
431424
lines.append(" ⌨ comment_body: '<comment_body>'")
432-
lines.append(" ⌨ comment_body_file: '<comment.md>'")
433425
lines.append(f" ⏎ Edit comment via {display_command()}: `{edit_cmd}`")
434-
lines.append(f" ⏎ Multi-line edit via {display_command()}: `{edit_file_cmd}`")
435426
else:
436427
lines.extend(_indent_block(display_summary))
437428
if event.resolved_hidden_count > 0:

tests/test_cli.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -558,22 +558,22 @@ def test_view_and_expand_use_real_cursor_pagination(
558558
assert "## Checks" in out
559559
assert "[IN_PROGRESS/NONE] unit-tests (check-run)" in out
560560
assert "passed checks hidden." in out
561+
assert "⌨ comment_body: '<comment_body>'" in out
561562
assert "gh pr comment 77928 --repo PaddlePaddle/Paddle --body '<comment_body>'" in out
562-
assert "gh pr comment 77928 --repo PaddlePaddle/Paddle --body-file <path-or->" in out
563563
assert "gh pr close 77928 --repo PaddlePaddle/Paddle" in out
564+
assert "⌨ labels_csv: '<label1>,<label2>'" in out
564565
assert "gh pr edit 77928 --repo PaddlePaddle/Paddle --add-label '<label1>,<label2>'" in out
565566
assert "gh pr edit 77928 --repo PaddlePaddle/Paddle --remove-label '<label1>,<label2>'" in out
567+
assert "⌨ reviewers_csv: '<reviewer1>,<reviewer2>'" in out
566568
assert "gh pr edit 77928 --repo PaddlePaddle/Paddle --add-reviewer '<reviewer1>,<reviewer2>'" in out
569+
assert "⌨ assignees_csv: '<assignee1>,<assignee2>'" in out
567570
assert "gh pr edit 77928 --repo PaddlePaddle/Paddle --add-assignee '<assignee1>,<assignee2>'" in out
568571
assert "link:" not in out
569572
assert (
570573
"Edit comment via gh-llm: `gh-llm pr comment-edit c3 --body '<comment_body>' --pr 77928 --repo PaddlePaddle/Paddle`"
571574
in out
572575
)
573-
assert (
574-
"Multi-line edit via gh-llm: `gh-llm pr comment-edit c3 --body-file <comment.md> --pr 77928 --repo PaddlePaddle/Paddle`"
575-
in out
576-
)
576+
assert "⌨ comment_body: '<comment_body>'" in out
577577

578578
pre_expand_calls = len(responder.calls)
579579
code = cli.run(["pr", "timeline-expand", "2", "--pr", "77928", "--repo", "PaddlePaddle/Paddle", "--page-size", "2"])
@@ -618,15 +618,12 @@ def test_view_and_expand_use_real_cursor_pagination(
618618
"Edit comment via gh-llm: `gh-llm pr comment-edit PRRC_self_1 --body '<comment_body>' --pr 77928 --repo PaddlePaddle/Paddle`"
619619
in out
620620
)
621-
assert "reply_body_file: '<reply.md>'" in out
622621
assert (
623-
"Multi-line reply via gh-llm: `gh-llm pr thread-reply PRRT_mock_1 --body-file <reply.md> --pr 77928 --repo PaddlePaddle/Paddle`"
624-
in out
625-
)
626-
assert (
627-
"Multi-line edit via gh-llm: `gh-llm pr comment-edit PRRC_self_1 --body-file <comment.md> --pr 77928 --repo PaddlePaddle/Paddle`"
622+
"Reply via gh-llm: `gh-llm pr thread-reply PRRT_mock_1 --body '<reply>' --pr 77928 --repo PaddlePaddle/Paddle`"
628623
in out
629624
)
625+
assert "⌨ comment_body: '<comment_body>'" in out
626+
assert "⌨ reply_body: '<reply>'" in out
630627
assert "Unresolve via gh-llm:" in out
631628

632629
code = cli.run(
@@ -1525,20 +1522,19 @@ def test_issue_view_and_expand_use_real_cursor_pagination(
15251522
assert "(comment hidden: outdated)" in out
15261523
assert "run `gh-llm issue comment-expand ic1 --issue 77924 --repo PaddlePaddle/Paddle` for full comment" in out
15271524
assert "## Actions" in out
1525+
assert "⌨ comment_body: '<comment_body>'" in out
15281526
assert "gh issue comment 77924 --repo PaddlePaddle/Paddle --body '<comment_body>'" in out
1529-
assert "gh issue comment 77924 --repo PaddlePaddle/Paddle --body-file <path-or->" in out
15301527
assert "gh issue close 77924 --repo PaddlePaddle/Paddle" in out
1528+
assert "⌨ labels_csv: '<label1>,<label2>'" in out
15311529
assert "gh issue edit 77924 --repo PaddlePaddle/Paddle --add-label '<label1>,<label2>'" in out
15321530
assert "gh issue edit 77924 --repo PaddlePaddle/Paddle --remove-label '<label1>,<label2>'" in out
1531+
assert "⌨ assignees_csv: '<assignee1>,<assignee2>'" in out
15331532
assert "gh issue edit 77924 --repo PaddlePaddle/Paddle --add-assignee '<assignee1>,<assignee2>'" in out
15341533
assert (
15351534
"Edit comment via gh-llm: `gh-llm issue comment-edit ic2 --body '<comment_body>' --issue 77924 --repo PaddlePaddle/Paddle`"
15361535
in out
15371536
)
1538-
assert (
1539-
"Multi-line edit via gh-llm: `gh-llm issue comment-edit ic2 --body-file <comment.md> --issue 77924 --repo PaddlePaddle/Paddle`"
1540-
in out
1541-
)
1537+
assert "⌨ comment_body: '<comment_body>'" in out
15421538
assert "cross-reference by @alice (Alice)" in out
15431539
assert "gh-llm pr view 77900 --repo PaddlePaddle/Paddle" in out
15441540
assert "issue/closed by @ShigureNyako" in out

0 commit comments

Comments
 (0)