remove --path flag to avoid session directory validation issues (#4662)
This commit is contained in:
@@ -80,7 +80,7 @@ jobs:
|
|||||||
- Include a descriptive test name that explains what is being tested
|
- Include a descriptive test name that explains what is being tested
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
goose run -i /tmp/create_working_test.txt --with-builtin developer --path /tmp/goose-home/.local/share/goose/sessions/test_generation.jsonl
|
goose run -i /tmp/create_working_test.txt --with-builtin developer
|
||||||
|
|
||||||
# Check the result
|
# Check the result
|
||||||
if [ -f /tmp/test_result.txt ]; then
|
if [ -f /tmp/test_result.txt ]; then
|
||||||
@@ -104,15 +104,29 @@ jobs:
|
|||||||
- name: Extract token metrics
|
- name: Extract token metrics
|
||||||
id: metrics
|
id: metrics
|
||||||
run: |
|
run: |
|
||||||
SESSION_FILE="/tmp/goose-home/.local/share/goose/sessions/test_generation.jsonl"
|
# Find the most recently created session file in the goose sessions directory
|
||||||
if [ -f "$SESSION_FILE" ]; then
|
SESSION_DIR="$HOME/.local/share/goose/sessions"
|
||||||
TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_total_tokens // 0')
|
if [ -d "$SESSION_DIR" ]; then
|
||||||
INPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_input_tokens // 0')
|
SESSION_FILE=$(ls -t "$SESSION_DIR"/*.jsonl 2>/dev/null | head -1)
|
||||||
OUTPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_output_tokens // 0')
|
if [ -f "$SESSION_FILE" ]; then
|
||||||
echo "total_tokens=${TOKENS}" >> $GITHUB_OUTPUT
|
echo "Found session file: $SESSION_FILE"
|
||||||
echo "input_tokens=${INPUT_TOKENS}" >> $GITHUB_OUTPUT
|
# Current context size metrics
|
||||||
echo "output_tokens=${OUTPUT_TOKENS}" >> $GITHUB_OUTPUT
|
TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.total_tokens // 0')
|
||||||
echo "Token usage - Total: ${TOKENS}, Input: ${INPUT_TOKENS}, Output: ${OUTPUT_TOKENS}"
|
INPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.input_tokens // 0')
|
||||||
|
OUTPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.output_tokens // 0')
|
||||||
|
echo "total_tokens=${TOKENS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "input_tokens=${INPUT_TOKENS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "output_tokens=${OUTPUT_TOKENS}" >> $GITHUB_OUTPUT
|
||||||
|
# Accumulated API usage metrics
|
||||||
|
ACC_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_total_tokens // 0')
|
||||||
|
ACC_INPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_input_tokens // 0')
|
||||||
|
ACC_OUTPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_output_tokens // 0')
|
||||||
|
echo "accumulated_total_tokens=${ACC_TOKENS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "accumulated_input_tokens=${ACC_INPUT_TOKENS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "accumulated_output_tokens=${ACC_OUTPUT_TOKENS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Token usage - Total: ${TOKENS}, Input: ${INPUT_TOKENS}, Output: ${OUTPUT_TOKENS}"
|
||||||
|
echo "Accumulated usage - Total: ${ACC_TOKENS}, Input: ${ACC_INPUT_TOKENS}, Output: ${ACC_OUTPUT_TOKENS}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
@@ -140,9 +154,14 @@ jobs:
|
|||||||
- [ ] No unnecessary changes included
|
- [ ] No unnecessary changes included
|
||||||
|
|
||||||
### Metrics
|
### Metrics
|
||||||
- **Total tokens used**: ${{ steps.metrics.outputs.total_tokens }}
|
#### Current Context Size
|
||||||
- **Input tokens**: ${{ steps.metrics.outputs.input_tokens }}
|
- **Total**: ${{ steps.metrics.outputs.total_tokens }} tokens
|
||||||
- **Output tokens**: ${{ steps.metrics.outputs.output_tokens }}
|
- **Input**: ${{ steps.metrics.outputs.input_tokens }} tokens
|
||||||
|
- **Output**: ${{ steps.metrics.outputs.output_tokens }} tokens
|
||||||
|
#### API Usage (Billable)
|
||||||
|
- **Total**: ${{ steps.metrics.outputs.accumulated_total_tokens }} tokens
|
||||||
|
- **Input**: ${{ steps.metrics.outputs.accumulated_input_tokens }} tokens
|
||||||
|
- **Output**: ${{ steps.metrics.outputs.accumulated_output_tokens }} tokens
|
||||||
|
|
||||||
---
|
---
|
||||||
*Generated by the Daily Test Coverage Finder workflow*
|
*Generated by the Daily Test Coverage Finder workflow*
|
||||||
@@ -164,4 +183,4 @@ jobs:
|
|||||||
echo "📝 Function tested: $FUNCTION_NAME"
|
echo "📝 Function tested: $FUNCTION_NAME"
|
||||||
else
|
else
|
||||||
echo "ℹ️ No suitable untested code found today"
|
echo "ℹ️ No suitable untested code found today"
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user