Skip to content

feat(miner-hands): Agent-SDK CodingAgentDriver (query() loop) - #4535

Closed
reyanthony062001-ops wants to merge 1 commit into
JSONbored:mainfrom
reyanthony062001-ops:feat/agent-sdk-coding-driver
Closed

feat(miner-hands): Agent-SDK CodingAgentDriver (query() loop)#4535
reyanthony062001-ops wants to merge 1 commit into
JSONbored:mainfrom
reyanthony062001-ops:feat/agent-sdk-coding-driver

Conversation

@reyanthony062001-ops

Copy link
Copy Markdown
Contributor

Closes #4267

What

The second CodingAgentDriver implementation (#4262's seam): createAgentSdkCodingAgentDriver drives the coding agent in-process via @anthropic-ai/claude-agent-sdk's query() async-iterable loop, complementing the CLI-subprocess path (#4266). New dependency @anthropic-ai/claude-agent-sdk@^0.3.205 on packages/gittensory-engine — verified net-new (no @anthropic-ai/* package anywhere in the repo before this), peer deps satisfied by existing root versions, npm audit --audit-level=moderate clean. One supply-chain note: the package publishes no SLSA/sigstore attestation yet; version is caret-pinned and lockfile-resolved.

How it maps to the issue's deliverables

Failure mapping: non-success result subtype → agent_sdk_<subtype>; success + is_erroragent_sdk_errored; stream ending without a result frame → agent_sdk_no_result; a mid-stream throw → agent_sdk_thrown: <redacted detail>. Everything that can carry model output (summary, transcript, error detail) passes through the engine's shared redactSecrets (#4284), bounded by a single named MAX_REDACTED_TEXT_LENGTH ceiling. Test fixtures build their secret-shaped strings at runtime, so no token-shaped literal appears anywhere in the diff.

Testing

  • 10 vitest cases in test/unit/agent-sdk-driver.test.ts (the codecov-measured path) and a parity-matched node:test suite in packages/gittensory-engine/test/ — success path (session options, hooks pass-through, changed-file tracking/dedupe, turn count), error_max_turns, is_error on a success subtype, unknown-subtype fallback, missing result frame, Error and non-Error mid-stream throws (redacted), secret redaction in summary/transcript, malformed-frame tolerance, and the no-options constructor.
  • Locally green on the final commit: engine workspace suite, root typecheck, git diff --check, npm audit --audit-level=moderate, and 100% line+branch coverage on the new module (npx vitest run test/unit/agent-sdk-driver.test.ts --coverage).

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.04%. Comparing base (86eeea0) to head (43aff35).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4535   +/-   ##
=======================================
  Coverage   94.04%   94.04%           
=======================================
  Files         422      423    +1     
  Lines       37579    37620   +41     
  Branches    13729    13748   +19     
=======================================
+ Hits        35340    35381   +41     
  Misses       1583     1583           
  Partials      656      656           
Files with missing lines Coverage Δ
...es/gittensory-engine/src/miner/agent-sdk-driver.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-09 23:31:44 UTC

6 files · no blockers · readiness 82/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • AI review already in progress for this PR head: Another Gittensory pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another Gittensory pass. Gittensory is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.
Signal Result Evidence
Code review ✅ No blockers No AI review summary
Linked issue ✅ Linked #4267
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 19 registered-repo PR(s), 10 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor reyanthony062001-ops; Gittensor profile; 19 PR(s), 1 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Addressed
The diff adds @​anthropic-ai/claude-agent-sdk to packages/gittensory-engine, implements createAgentSdkCodingAgentDriver that drives query() and folds streamed messages into the shared CodingAgentDriverResult shape (changedFiles, transcript, turnsUsed, ok/error) without leaking SDK types, forwards task.workingDirectory/maxTurns/instructions matching #4262's interface, forwards caller-supplied hooks

Review context
  • Author: reyanthony062001-ops
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 19 PR(s), 1 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (issue #4307, issue #4266)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 9, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Merge conflicts, fix + resubmit:

This branch has conflicts that must be resolved
Use the [web editor](https://github.com/JSONbored/gittensory/pull/4535/conflicts) or the command line to resolve conflicts before continuing.

package-lock.json
packages/gittensory-engine/package.json
packages/gittensory-engine/src/index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-hands): Agent-SDK CodingAgentDriver (query() loop)

2 participants