Skip to content

Commit 6f69cd0

Browse files
committed
refactor: move get-output-agent staleness instructions into GetOutput.java
1 parent 59f78d9 commit 6f69cd0

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

  • .cat/issues/v2/v2.1/add-empirical-tests-get-output-agent
  • client/src/main/java/io/github/cowwoc/cat/hooks/skills

.cat/issues/v2/v2.1/add-empirical-tests-get-output-agent/PLAN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ None
3535
must match ONLY the latest output text and explicitly exclude the earlier content string.
3636

3737
## Files to Modify
38-
- `plugin/skills/get-output-agent/SKILL.md` — improved by `cat:instruction-builder-agent`
38+
- `client/src/main/java/io/github/cowwoc/cat/hooks/skills/GetOutput.java` — update Step 1 and Verification to reference the LAST `<output>` tag (prevents staleness when the skill is invoked multiple times)
39+
- `plugin/skills/get-output-agent/SKILL.md` — remove appended instructions (staleness guidance now lives in GetOutput.java)
3940
- `plugin/skills/get-output-agent/first-use.md` — may be improved by `cat:instruction-builder-agent`
4041

4142
## Pre-conditions

client/src/main/java/io/github/cowwoc/cat/hooks/skills/GetOutput.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,13 @@ public String getOutput(String[] args) throws IOException
146146
147147
## Procedure
148148
149-
### Step 1: Locate the rendered output
149+
### Step 1: Locate the current output tag
150150
151-
Find the `<output>` tag injected above by the preprocessor directive. It contains the complete pre-rendered %s
152-
display.
151+
Scan the conversation from the **end** toward the beginning. Find the **last** (most recently appearing)
152+
`<output>` tag. This is the current output injected by the preprocessor directive above.
153+
154+
**CRITICAL:** Prior invocations of this skill may have left earlier `<output>` tags earlier in the
155+
conversation. Those are stale. Only the LAST `<output>` tag is current.
153156
154157
If the `<output>` tag is missing, empty, or contains error content: report "%s display unavailable." and stop. \
155158
Do not investigate the cause, run commands, or construct/infer/approximate the %s display by any means.
@@ -170,13 +173,14 @@ public String getOutput(String[] args) throws IOException
170173
## Verification
171174
172175
- [ ] The rendered %s display from the `<output>` tag is printed completely and without modification
176+
- [ ] The output matches the content of the LAST `<output>` tag in context, not an earlier one
173177
- [ ] No additional text, commentary, or formatting was added
174178
- [ ] No project files were read and no tools or commands were run
175179
- [ ] The agent stopped after outputting without offering follow-up or next steps
176180
177181
<output type="%s">
178182
%s
179-
</output>""".formatted(skill, skill, skill, skill, skill, skill, skill, sanitizedType, content);
183+
</output>""".formatted(skill, skill, skill, skill, skill, skill, sanitizedType, content);
180184
}
181185

182186
/**

0 commit comments

Comments
 (0)