Conversation
cornellgit
reviewed
May 20, 2025
cornellgit
reviewed
May 20, 2025
cornellgit
approved these changes
May 20, 2025
davidli2010
pushed a commit
to davidli2010/adk-go
that referenced
this pull request
Feb 4, 2026
9 tasks
wolo-lab
added a commit
that referenced
this pull request
May 12, 2026
…rs to import agent directly Sweeps the 28 importers of internal/context (alias 'icontext' or 'contextinternal') to use agent.NewX directly. The alias layer introduced in PR #1 was a transitional stage; with PR #2 (unified agent.Context interface) landed, no consumer needs internal/context any more. Mechanical changes: * `icontext.NewInvocationContext` → `agent.NewInvocationContext` (most uses) * `icontext.InvocationContextParams` → `agent.InvocationContextParams` * `icontext.NewCallbackContext` → `agent.NewCallbackContext` (2 uses) * `icontext.NewCallbackContextWithDelta` → `agent.NewCallbackContextWithDelta` (8 uses) * `icontext.NewReadonlyContext` → `agent.NewReadonlyContext` (3 uses) Per-file: 28 importer files lose their `icontext "…/internal/context"` import line. `internal/toolinternal/context_test.go` had a different alias name (`contextinternal`); also rewritten. One ad-hoc fix: `agent/remoteagent/v2/utils_test.go` had a local variable named `agent` shadowing the package name; renamed to `a` (unrelated to the sweep but exposed by it). Then deletes `internal/context/` entirely. The package no longer exists; `agent` is the single home for canonical context constructors. Verified: go build ./...; go vet ./...; go test ./...; all pass.
9 tasks
wolo-lab
added a commit
that referenced
this pull request
May 12, 2026
…#1) Same goal as wolo/context_unif_v2_pr1_move (eliminate the 3 pairs of duplicate context impls + the duplicate internalArtifacts helper), opposite execution: keeps existing implementations in agent/agent.go instead of moving them to new files. What's added to agent/agent.go (~146 lines): * internalArtifacts wrapper (delta-tracking for Save). * NewCallbackContext / NewCallbackContextWithDelta constructors. * artifacts field on callbackContext + updated Artifacts() to return the wrapper (bug fix: previously returned unwrapped Artifacts, so Save() in callbacks didn't record into EventActions.ArtifactDelta). * NewInvocationContext + InvocationContextParams. * readonlyContext struct + 8 methods + NewReadonlyContext. * InvocationOf helper (returns underlying InvocationContext from a NewReadonlyContext-produced ReadonlyContext). * runBeforeAgentCallbacks / runAfterAgentCallbacks switched from raw struct literal to newCallbackContextImpl (no behavioural change — the new bug fix takes effect either way). What's removed: * internal/context/{invocation,callback,readonly}_context.go shrink to thin alias layers (var NewX = agent.NewX). * internal/context/context_test.go deleted (its TestWithContext sibling already exists in agent/agent_test.go; the other two tests can be re-added in agent/ if desired). * internal/toolinternal.internalArtifacts dropped (toolContext now relies on the embedded CallbackContext for Artifacts wrapping — eliminates double-wrapping bug). * util/instructionutil drops the icontext import; uses agent.InvocationOf instead of *icontext.ReadonlyContext type assertion. Trade-off vs the canonical PR #1: * agent/agent.go grows from 521 to ~660 lines (mixing Agent + Run + Context impls + helpers in one file). * 7 files touched instead of 13; +168/-352 = -184 lines net, versus +489/-537 = -48 net for PR #1. ~136 lines smaller diff. * No new files in agent/ (3 fewer in git status). This branch exists for comparison; whichever direction we pick gets PRs #2 and #3 stacked on top. Verified: go build ./...; go vet ./...; go test ./...; all pass.
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.
No description provided.