Skip to content

[Midtown !3] Wire expand_session_id_in_prompt into spawn#2334

Merged
btucker merged 2 commits intomainfrom
task-3-wire-expand-session-id-in-prompt-into
Apr 7, 2026
Merged

[Midtown !3] Wire expand_session_id_in_prompt into spawn#2334
btucker merged 2 commits intomainfrom
task-3-wire-expand-session-id-in-prompt-into

Conversation

@btucker
Copy link
Copy Markdown
Owner

@btucker btucker commented Apr 7, 2026

Summary

  • Calls expand_session_id_in_prompt() on headless_config.system_prompt immediately after the UUID is pre-assigned at spawn time
  • Calls expand_session_id_in_prompt() on the initial prompt before delivering it via stdin
  • Fixes the root cause: single-quoted heredocs (<<'EOF') used when passing prompts to the claude CLI suppress shell variable expansion, so $MIDTOWN_SESSION_ID was never replaced — agents were writing the literal placeholder into GitHub frontmatter instead of the real UUID

Test plan

  • Existing test_expand_session_id_replaces_env_var_in_prompt and test_reviewer_system_prompt_contains_unexpanded_session_id tests cover the expansion function itself
  • cargo test spawn passes
  • cargo test expand_session_id passes
  • Spawned agents now embed the real session UUID in <!-- midtown session:UUID --> PR/comment frontmatter

🌃 Co-built with Midtown

…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
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.95%. Comparing base (05897b0) to head (165f5c2).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/daemon_v2/executor/spawn.rs 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
src/daemon_v2/executor/spawn.rs 97.91% <85.71%> (+0.09%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@btucker btucker merged commit ecf1efc into main Apr 7, 2026
13 checks passed
@btucker btucker deleted the task-3-wire-expand-session-id-in-prompt-into branch April 7, 2026 04:00
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