Add automsg generated update descriptions#353
Merged
Merged
Conversation
…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]
Owner
Author
|
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]
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]
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]
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.
No description provided.