[Midtown !3] Wire expand_session_id_in_prompt into spawn#2334
Merged
Conversation
…wn time Single-quoted heredocs used to pass prompts to the claude CLI prevent shell expansion of $MIDTOWN_SESSION_ID. By calling expand_session_id_in_prompt() on both the system prompt and initial prompt immediately after the UUID is pre-assigned, agents receive the real session UUID and can embed it verbatim in GitHub PR/comment frontmatter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2334 +/- ##
==========================================
+ Coverage 63.70% 63.95% +0.25%
==========================================
Files 100 100
Lines 38582 38596 +14
==========================================
+ Hits 24578 24684 +106
+ Misses 14004 13912 -92
🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
expand_session_id_in_prompt()onheadless_config.system_promptimmediately after the UUID is pre-assigned at spawn timeexpand_session_id_in_prompt()on the initial prompt before delivering it via stdin<<'EOF') used when passing prompts to theclaudeCLI suppress shell variable expansion, so$MIDTOWN_SESSION_IDwas never replaced — agents were writing the literal placeholder into GitHub frontmatter instead of the real UUIDTest plan
test_expand_session_id_replaces_env_var_in_promptandtest_reviewer_system_prompt_contains_unexpanded_session_idtests cover the expansion function itselfcargo test spawnpassescargo test expand_session_idpasses<!-- midtown session:UUID -->PR/comment frontmatter🌃 Co-built with Midtown