Skip to content

Add automsg generated update descriptions#353

Merged
ezyang merged 4 commits into
mainfrom
gh/ezyang/66/head
May 13, 2026
Merged

Add automsg generated update descriptions#353
ezyang merged 4 commits into
mainfrom
gh/ezyang/66/head

Conversation

@ezyang
Copy link
Copy Markdown
Owner

@ezyang ezyang commented May 13, 2026

No description provided.

…onfig options (e.g. `ghstack config automsg claude`). Wire the new `automsg` config option through to the submit flow: when set and no explicit `-m` is provided, ghstack writes PR context to a temp file, computes an interdiff against the previous PR patch, and invokes the configured LLM command (claude or codex) to generate a change description. Includes a fake-LLM integration test that verifies interdiff-based descriptions and a CLI config unit test. Updates README with usage examples.

[ghstack-poisoned]
@ezyang
Copy link
Copy Markdown
Owner Author

ezyang commented May 13, 2026

Stack from ghstack (oldest at bottom):

Change the automsg prompt to request git commit-style output (short subject
line, blank line, body) instead of a generic "concise pull request update
description." This gives the LLM clearer formatting instructions and
produces more structured change descriptions.

Also add an `logging.info` call that logs each generated automsg description
along with the diff title, making it easier to debug and audit what the
model produced.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 13, 2026
ghstack-source-id: 550da1a
ghstack-comment-id: 4443700980
Pull-Request: #353
Use `posix=os.name != "nt"` in `shlex.split` to handle Windows
command parsing correctly.

Rework the fake LLM test script to be invoked via `sys.executable`
instead of as a standalone executable with a shebang. This avoids
chmod and makes the test work on Windows. The test script now receives
the context path and prompt as positional arguments rather than using
`-p` flag style, and adds an explicit assertion that the context path
argument matches the one embedded in the prompt.

Minor type annotation improvements: add `Dict[int, str]` return type
to `pull_request_patches()` and replace `import os` with `import sys`
and `from typing import Dict` in the test file.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 13, 2026
ghstack-source-id: 4296ab9
ghstack-comment-id: 4443700980
Pull-Request: #353
Introduce a `_head_commit_message` method that prefixes head branch commit
messages with `[INITIAL]` or `[UPDATE]` tags depending on whether the
commit is the first submission or a subsequent update. This makes it easy
to distinguish initial submissions from updates when browsing the head
branch history (e.g., via `ghstack log` or `git log` on the head ref).

The head commit message (used for the poisoned commits on `gh/*/head`
branches) now passes through `_head_commit_message` instead of using
`self.msg` directly. The underlying update description (`update_msg`)
generated by `_change_description` is unchanged and still used for PR
body annotations.

Also update all test expectations to reflect the new `[INITIAL]`/`[UPDATE]`
prefixed commit messages, and fix an import ordering issue in
`test_cli_config.py`.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 13, 2026
ghstack-source-id: cd04c30
ghstack-comment-id: 4443700980
Pull-Request: #353
@ezyang ezyang enabled auto-merge (squash) May 13, 2026 18:57
@ezyang ezyang merged commit 02e2120 into main May 13, 2026
16 checks passed
@ezyang ezyang deleted the gh/ezyang/66/head branch May 13, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant