Skip to content

Commit ce4ed15

Browse files
authored
chore: Tweak agent runner to be more general-purpose (#326)
Two changes: 1. Change the variable name from TYPESCRIPT_SESSIONS_BUCKET -> AGENT_SESSIONS_BUCKET; this makes the agent code more general purpose than *just* TS 2. Use a session prefix that is equal to the GH repo name - this enables different repositories (and forks) to not conflict with eachother Co-authored-by: Mackenzie Zastrow <[email protected]>
1 parent 3ff1e52 commit ce4ed15

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/scripts/python/agent_runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ def run_agent(query: str):
109109
system_prompt = os.getenv("INPUT_SYSTEM_PROMPT", DEFAULT_SYSTEM_PROMPT)
110110
session_id = os.getenv("SESSION_ID")
111111
s3_bucket = os.getenv("S3_SESSION_BUCKET")
112+
s3_prefix = os.getenv("GITHUB_REPOSITORY", "")
112113

113114
if s3_bucket and session_id:
114115
print(f"🤖 Using session manager with session ID: {session_id}")
115116
session_manager = S3SessionManager(
116117
session_id=session_id,
117118
bucket=s3_bucket,
118-
prefix="",
119+
prefix=s3_prefix,
119120
)
120121
else:
121122
raise ValueError("Both SESSION_ID and S3_SESSION_BUCKET must be set")

.github/workflows/strands-command.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
session_id: ${{ needs.setup-and-process.outputs.session_id }}
134134
task_prompt: ${{ needs.setup-and-process.outputs.prompt }}
135135
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
136-
sessions_bucket: ${{ secrets.TYPESCRIPT_SESSIONS_BUCKET }}
136+
sessions_bucket: ${{ secrets.AGENT_SESSIONS_BUCKET }}
137137
write_permission: 'false'
138138
ref: ${{ needs.setup-and-process.outputs.branch }}
139139

0 commit comments

Comments
 (0)