Repository navigation
feat(worker): log the job count of AgentCore jobs - #956
Open
ParidelPooya wants to merge 4 commits into
Open
ParidelPooya wants to merge 4 commits into
ParidelPooya wants to merge 4 commits into
Conversation
Each log line of an AgentCore job now carries jobCount. jobCount is the number of jobs that this worker process has run, counting this job. The lines already carry runtimeSessionId. A new test checks both fields on the "job started" line. Closes #949
The job count now goes up in the request handler, under the lock that registers the callback ID. The job thread receives the count as an argument. So the count follows the order in which the worker accepts the jobs. A job counts when the worker accepts it. The test now sends cb-1 twice. The repeated delivery does not change the count, and its log line has no jobCount. The logger argument of start_agentcore_worker now documents the log fields of a job: callbackId, runtimeSessionId and jobCount.
ParidelPooya
marked this pull request as ready for review
November 23, 2026 23:26
ParidelPooya
had a problem deploying
to
ai-pr-review-runtime
November 23, 2026 23:26 — with
GitHub Actions
Error
This comment has been minimized.
This comment has been minimized.
Only the worker's own job lines carry callbackId, runtimeSessionId and jobCount. Heartbeat, callback and handler lines do not. Say so in the logger docs instead of implying every job line has them.
Contributor
Codex AI reviewOne approach finding remains at Suppressed repeats
Reviewed commit |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available
Closes #949
Part of #954
Twin: aws/aws-durable-execution-sdk-js#1240
Description of changes
What
This change adds the field
jobCountto every log line of an AgentCore job.Why
The
agentcore_sessionepic sends several jobs to one AgentCore session. One session runs in one worker process. So a reader of the logs needs to see which session a job ran in, and how many jobs that process ran before it.Change
runtimeSessionId. This change keeps that field.jobCount. Its value is the count that includes this job. So the first job of a process logsjobCount: 1.ignored a repeated jobline has nojobCount.loggerargument ofstart_agentcore_workerdocuments the log fields of a job:callbackId,runtimeSessionIdandjobCount.Testing
cb-1,cb-1again, andcb-2, with two session IDs. It checkscallbackId,runtimeSessionIdandjobCounton bothjob startedlines. It checks that the repeated delivery ofcb-1does not change the count, and that its line has nojobCount.jobCountis removed from the fields, and whenruntimeSessionIdis set toNone.tests/agentcore: 35 passed.test_create_raises_when_boto3_cannot_build_the_client. It fails the same way onmainon my host, because of the host's AWS configuration.mypy src tests: no issues.hatch fmt --check(hatch 1.16.5): all checks passed.Design
Assumptions
Decisions not covered by the issue or the design note
jobCount, after the issue title. The JS twin should use the same name.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.