Repository navigation
feat(harness): add interactive shell command - #2548
aidandaly24 wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice refactor pulling ShellOperation and ShellHandoff out of the Runtime shell path so Harness can reuse them, and the new src/core/harnessShell.ts with its retry/initialization-wait logic is well covered by harnessShell.test.ts. Validation in request.ts (readiness, ARN shape, CUSTOM_JWT vs IAM authorizer vs --bearer-token) is thorough, and the screen navigation (preselected harness → endpoint picker, returnOnEscape from the detail hub) is backed by tests. Didn't find anything that requires changes before merging.
One thing worth double-checking (not blocking): in createHarnessShellOpener's _wsFactory, every connection reassigns currentReadiness and attaches a .then(..., (err) => { initializationFailed(err); void session.close(); }). After the initial openShell has returned, initializationFailed on the already-resolved promise is a no-op, but the session.close() still fires if a reconnect fails its initialization handshake — effectively tearing the whole session down on any reconnect-time init failure. If that's intentional (fail-fast on reconnect init), great; if the SDK is expected to retry reconnects internally, this will short-circuit them. Worth confirming against the SDK's reconnect semantics, but not blocking.
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
545485a to
750af9f
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## refactor #2548 +/- ##
============================================
+ Coverage 97.39% 97.41% +0.01%
============================================
Files 642 651 +9
Lines 46910 47346 +436
============================================
+ Hits 45689 46120 +431
- Misses 1221 1226 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Add
agentcore harness shell, alongside the Runtime-shell diagnostic fix in #2544. These PRs are intended to ship together: merge the Harness shell command before the diagnostic starts recommending it.--qualifier; preserve--session-idand sensitive--bearer-tokenthrough the picker.core.harness.openHarnessShell, never the backing Runtime ARN. Use the existing cached SDK data client's endpoint/credentials/signing configuration.ShellSessionfor framing, reconnect, keepalive, writes, resize, and close. The high-level Runtime SDK helper does not accept Harness ARNs.wsand@types/wspackages directly. No package versions change.Tests focus on the Harness-specific connection/CLI boundaries and extend existing menu/detail coverage. Existing Runtime/terminal tests cover shared behavior, including the retained error, Runtime hint, retry, endpoint back navigation, and a subsequent successful attempt.
Related Issue
Paired with #2544. CLI v1 feedback, item 20; no separate GitHub issue supplied.
Documentation PR
Included: generated
command.mdsection forharness shell; unrelated pre-existing reference drift is excluded.Type of Change
Testing
bun testbun run test:e2e, or explained why they are not applicablebun run typecheckbun run lint:checkbun run format:checkbun run buildsrc/assets/, I updated affected snapshots withbun test <test-file> --update-snapshotsand committed them (not applicable)Results:
refactor(133fb626); range-diff confirms all eight commits retain identical patches.git diff --check: pass.harness shell --helpfrom both distributions: pass.bun testafter rebasing, outside the restricted sandbox: 3,990 pass, 0 fail.--profile deployagainst an existing demo harness: the Node bundle connected through the Harness ARN, a marker command returned the expected output, andexitclosed the shell with code 0.--session-id, the shell connected and ran a second marker command, and closing it with code 0 returned to the endpoint picker.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.