Skip to content

Commit 9d90596

Browse files
committed
agents.just: Fix failing multiline read
Signed-off-by: Tzanko Matev <[email protected]>
1 parent 29a838a commit 9d90596

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

agents.just

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ set unstable
22
# We are using an unstable feature here: [script] recipies. To
33
# configure the script interpreter you can do
44
#
5-
# set script-interpreter := ...
5+
# set script-interpreter := ["sh","-eu"]
66
#
77
# The default script interpreter crashes on error which is the
88
# behavior that we desire.
99

10-
1110
# Runs the given task in a workspace
1211
workspace_just := "just -d . --justfile .agent-tools/agents.just"
1312

@@ -23,7 +22,8 @@ consolidate workspace_id start_change_id end_change_id: (run workspace_id "conso
2322

2423
[script]
2524
consolidate-inner start_change_id end_change_id:
26-
read -r -d '' INSTRUCTIONS <<-EOF
25+
INSTRUCTIONS=$(
26+
cat <<-'EOF'
2727
You will be given a diff with 'jj diff --from {{start_change_id}} --to {{end_change_id}}'. The task is to write a specification which describes the introduced changes.
2828

2929
You need to produce a full detailed specification in the folder 'specs/'. Imagine that the changes that the diff shows disappeared and we had to implement the functionality from scratch. The specification must contain all necessary details in order to be possible to implement equivalent functionality.
@@ -42,6 +42,7 @@ consolidate-inner start_change_id end_change_id:
4242
`jj diff --from {{start_change_id}} --to {{end_change_id}}`
4343

4444
EOF
45+
)
4546

4647
jj new -r {{start_change_id}} -m "Consolidation in progress"
4748

@@ -65,19 +66,26 @@ workspace-sync-tools workspace_id:
6566

6667
questions-for-pm workspace_id rev='@': (run workspace_id "questions-for-pm" "questions-for-pm-inner" rev)
6768

69+
6870
[script]
6971
questions-for-pm-inner rev='@':
70-
read -r -d '' INSTRUCTIONS_1 <<-EOF
71-
1. Read the current state of open issues in issues.md
72+
echo "AAA"
73+
echo "BBB"
74+
INSTRUCTIONS_1=$(
75+
cat <<-'EOF'
76+
1. Read the current state of open issues in issues.md
7277
2. Read relevant state of the code base
7378
3. Read 'pm-faq.md' which contains previous questions asked to the product manager and her answers.
7479
4. Create questions to the product manager to clarify unclear design choices, priorities and so on. If everything is clear and no questions are needed do nothing.
7580
5. Append the new questions to the end of 'pm-faq.md' file
7681

7782
# Rules for the pm-faq.md file
7883
- Only ask questions related to issues in issues.md. In each question clearly mark which issues motivated this question
84+
7985
EOF
86+
)
8087

88+
echo "BBB"
8189
jj new -r {{rev}} -m "Questions for the PM"
8290
PM_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
8391

@@ -130,7 +138,8 @@ pm-flow-update workspace_id rev='@': (run workspace_id "pm-flow-update" "pm-flow
130138

131139
[script]
132140
pm-flow-update-inner rev='@':
133-
read -r -d '' INSTRUCTIONS_2 <<-EOF
141+
INSTRUCTIONS_2=$(
142+
cat <<-'EOF'
134143
1. Read the current state of open issues in 'issues.md'
135144
2. Read the conversation with the product manager so far in 'pm-faq.md'. Read ONLY THE LATEST SECTION. IGNORE PREVIOUS SECTIONS as they were already handled
136145
3. If necessary read relevant parts of the code
@@ -142,6 +151,7 @@ pm-flow-update-inner rev='@':
142151
143152
`cat rules/issues.md`
144153
EOF
154+
)
145155
146156
CURRENT_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
147157
@@ -325,10 +335,12 @@ review-old workspace_id start_rev end_rev: (run workspace_id "review-old" "revie
325335
review-old-inner start_rev end_rev:
326336
CURRENT_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
327337
328-
read -r -d '' INSTRUCTIONS <<-EOF
338+
INSTRUCTIONS=$(
339+
cat <<-'EOF'
329340
I was working on something long ago but I forgot what I was doing. Go over the changes and bring me up-to-speed. The changes in question are all changes between "{{start_rev}}" and "{{end_rev}}".
330341
Recall that we are using Jujutsu VCS. Check the documentation on the web if you don''t know something about it.
331342
EOF
343+
)
332344
333345
{{codex-ui}} "$INSTRUCTIONS"
334346

0 commit comments

Comments
 (0)