Skip to content

feat: store prompt in agent runner step result - #1456

Merged
k1LoW merged 2 commits into
mainfrom
feat/agent-store-prompt
Apr 15, 2026
Merged

k1LoW merged 2 commits into
mainfrom
feat/agent-store-prompt

Conversation

@k1LoW

@k1LoW k1LoW commented Apr 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Store the expanded prompt in the agent runner's step result so it can be accessed via steps[N].prompt
  • Add test assertion for the stored prompt value

Store the expanded prompt in the step result so it can be accessed
via steps[N].prompt in subsequent steps and expressions.
@k1LoW k1LoW self-assigned this Apr 15, 2026
@k1LoW k1LoW added the enhancement New feature or request label Apr 15, 2026
@k1LoW
k1LoW requested a review from Copilot April 15, 2026 13:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stores the expanded agent prompt into each agent step’s recorded result so the prompt is accessible from the step results (e.g., steps[N].prompt), and updates the agent runner unit test to assert this behavior.

Changes:

  • Add an agentStorePromptKey constant and record parsed.Prompt into the step result map during agent runner execution.
  • Extend TestAgentRunnerRun to assert the prompt is present and correct in the operator store’s latest step result.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
agent.go Records the expanded prompt alongside the agent response in the step result store.
agent_test.go Adds assertions verifying the stored prompt value is present and correct.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

BenchmarkManyRunbooks-4

main (-) #1456 (cf9ce70) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 3,821,638,451 ns/op 3,818,175,493 ns/op -3,462,958 ns/op
Bytes allocated per iteration 1,391,466,248 B/op 1,391,230,904 B/op -235,344 B/op
Allocs per iteration 19,360,832 allocs/op 19,360,651 allocs/op -181 allocs/op
Metadata
main (-) #1456 (cf9ce70)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/runn github.com/k1LoW/runn
cpu AMD EPYC 7763 64-Core Processor AMD EPYC 7763 64-Core Processor

BenchmarkOpenAPI3-4

main (-) #1456 (cf9ce70) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 1,394,963,842 ns/op 1,400,510,469 ns/op 5,546,627 ns/op
Bytes allocated per iteration 801,835,456 B/op 802,613,688 B/op 778,232 B/op
Allocs per iteration 10,815,410 allocs/op 10,815,560 allocs/op 150 allocs/op
Metadata
main (-) #1456 (cf9ce70)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/runn github.com/k1LoW/runn
cpu AMD EPYC 7763 64-Core Processor AMD EPYC 7763 64-Core Processor

BenchmarkSingleRunbook-4

main (-) #1456 (cf9ce70) +/-
Number of iterations 22 24 2
Nanoseconds per iteration 48,044,789 ns/op 48,056,819 ns/op 12,030 ns/op
Bytes allocated per iteration 23,026,724 B/op 23,044,899 B/op 18,175 B/op
Allocs per iteration 186,927 allocs/op 186,944 allocs/op 17 allocs/op
Metadata
main (-) #1456 (cf9ce70)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/runn github.com/k1LoW/runn
cpu AMD EPYC 7763 64-Core Processor AMD EPYC 7763 64-Core Processor

Reported by octocov

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (9bee5f8) #1456 (5293900) +/-
Coverage 59.8% 59.8% 0.0%
Code to Test Ratio 1:0.8 1:0.8 +0.0
Test Execution Time 7m45s 7m43s -2s
Details
  |                     | main (9bee5f8) | #1456 (5293900) | +/-  |
  |---------------------|----------------|-----------------|------|
  | Coverage            |          59.8% |           59.8% | 0.0% |
  |   Files             |             85 |              85 |    0 |
  |   Lines             |           9832 |            9832 |    0 |
  |   Covered           |           5886 |            5886 |    0 |
+ | Code to Test Ratio  |          1:0.8 |           1:0.8 | +0.0 |
  |   Code              |          18453 |           18455 |   +2 |
+ |   Test              |          15351 |           15358 |   +7 |
+ | Test Execution Time |          7m45s |           7m43s |  -2s |

Code coverage of files in pull request scope (85.0% → 85.0%)

Files Coverage +/- Status
agent.go 82.0% 0.0% modified
agent_test.go 93.1% 0.0% modified

Reported by octocov

@k1LoW
k1LoW merged commit 598edc0 into main Apr 15, 2026
19 of 21 checks passed
@k1LoW
k1LoW deleted the feat/agent-store-prompt branch April 15, 2026 13:58
@github-actions github-actions Bot mentioned this pull request Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址