Conversation
📝 WalkthroughWalkthroughRemoved the exported StacksManager interface; provider preparer now accepts a concrete Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Session
participant StacksMgr as "stacks.Manager"
participant ProviderPrep as "providerPreparer"
User->>Session: start session / request stack
alt Interactive selection
Session->>StacksMgr: List / Read available stacks
StacksMgr-->>Session: stacks list
Session->>User: prompt & select stack
else Specified or remote
Session->>StacksMgr: LoadLocal / LoadRemote
StacksMgr-->>Session: stack parameters
end
Session->>StacksMgr: LoadStackEnv(stack, false)
StacksMgr-->>Session: env loaded / error
Session->>ProviderPrep: pass selected stack (with env)
ProviderPrep-->>Session: continue provider setup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter" Comment |
b851cea to
f4e96e1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pkg/agent/tools/provider.go`:
- Around line 44-49: The code calls stacks.LoadStackEnv(*stack, false) before
assigning *stack = *newStack, so it loads env from the old stack; move the
assignment *stack = *newStack to occur before calling stacks.LoadStackEnv and
then call stacks.LoadStackEnv(*stack, false) with the updated stack, preserving
the existing error handling (i.e., check err and return fmt.Errorf("failed to
load stack env: %w", err) if it fails).
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pkg/session/session.go`:
- Around line 152-180: The loadFallbackStack function has multiple compile
issues: remove or use the unused local whence (set by DEFANG_PROVIDER check) —
simplest fix is to drop the whence variable entirely; when handling the
GetDefaultStack response, use params (not undefined stack) when calling
stacks.LoadStackEnv and do not redeclare err (use assignment: err =
stacks.LoadStackEnv(params, false) or err = stacks.LoadStackEnv(*params, false)
depending on signature); ensure you pass the correct params type expected by
stacks.LoadStackEnv and propagate the error if non-nil; also fix indentation to
match project style (tabs). Locate symbols: loadFallbackStack,
sl.client.GetDefaultStack, stacks.NewParametersFromContent, params, and
stacks.LoadStackEnv.
Description
This PR moves the responsibility of setting the stack env vars out of the stacks manager and into the session
Linked Issues
Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.