Skip to content

Commit ca30867

Browse files
committed
fix(go-adk): resolve merge conflict with main in bedrock.go
main removed TopK as a standalone field (it now goes through AdditionalModelRequestFields) and dropped reverseNameMap from the generate functions. This branch needs reverseNameMap for tool name sanitization, so both additionalFields and reverseNameMap are kept in generateStreaming and generateNonStreaming. Duplicate declarations introduced during the merge are removed. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
2 parents 7c4e1b9 + 4684388 commit ca30867

63 files changed

Lines changed: 1606 additions & 476 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,6 @@ updates:
8080
- "minor"
8181
- "patch"
8282

83-
# Python (uv) — sample applications
84-
- package-ecosystem: "uv"
85-
directories:
86-
- "/python/samples/adk/basic"
87-
- "/python/samples/openai/basic_agent"
88-
- "/python/samples/crewai/poem_flow"
89-
- "/python/samples/crewai/research-crew"
90-
- "/python/samples/langgraph/currency"
91-
- "/go/core/test/e2e/agents/kebab"
92-
schedule:
93-
interval: "weekly"
94-
day: "monday"
95-
open-pull-requests-limit: 5
96-
labels:
97-
- "dependencies"
98-
commit-message:
99-
prefix: "chore(deps):"
100-
reviewers:
101-
- "EItanya"
102-
- "peterj"
103-
- "yuval-k"
104-
groups:
105-
samples-minor-patch:
106-
patterns:
107-
- "*"
108-
update-types:
109-
- "minor"
110-
- "patch"
111-
11283
# npm — Next.js UI
11384
- package-ecosystem: "npm"
11485
directory: "/ui"
@@ -158,32 +129,3 @@ updates:
158129
update-types:
159130
- "minor"
160131
- "patch"
161-
162-
# Docker — sample and test images
163-
- package-ecosystem: "docker"
164-
directories:
165-
- "/python/samples/adk/basic"
166-
- "/python/samples/openai/basic_agent"
167-
- "/python/samples/crewai/poem_flow"
168-
- "/python/samples/crewai/research-crew"
169-
- "/python/samples/langgraph/currency"
170-
- "/go/core/test/e2e/agents/kebab"
171-
schedule:
172-
interval: "weekly"
173-
day: "monday"
174-
open-pull-requests-limit: 5
175-
labels:
176-
- "dependencies"
177-
commit-message:
178-
prefix: "chore(deps):"
179-
reviewers:
180-
- "EItanya"
181-
- "peterj"
182-
- "yuval-k"
183-
groups:
184-
docker-samples-minor-patch:
185-
patterns:
186-
- "*"
187-
update-types:
188-
- "minor"
189-
- "patch"

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ jobs:
4343
uses: actions/checkout@v6
4444
- name: Initialize Environment
4545
uses: ./.github/actions/initialize-environment
46+
- name: Allow unprivileged user namespaces
47+
# Ubuntu 24.04 (ubuntu-latest) enables AppArmor-based restrictions on
48+
# unprivileged user namespaces by default, which causes bubblewrap
49+
# to fail with EPERM on unshare(CLONE_NEWUSER)
50+
# See https://github.com/openai/codex/issues/14919
51+
run: |
52+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
4653
- name: Set up QEMU
4754
uses: docker/setup-qemu-action@v4
4855
with:
@@ -195,6 +202,7 @@ jobs:
195202
- name: Run helm unit tests
196203
run: |
197204
helm unittest helm/kagent
205+
helm unittest helm/tools/querydoc
198206
199207
ui-tests:
200208
runs-on: ubuntu-latest

.github/workflows/image-scan.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,25 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
image:
29-
- controller
30-
- ui
31-
- app
32-
- skills-init
33-
- golang-adk
34-
- golang-adk-full
28+
include:
29+
- build_target: controller
30+
image_name: controller
31+
tag_suffix: ""
32+
- build_target: ui
33+
image_name: ui
34+
tag_suffix: ""
35+
- build_target: app
36+
image_name: app
37+
tag_suffix: ""
38+
- build_target: skills-init
39+
image_name: skills-init
40+
tag_suffix: ""
41+
- build_target: golang-adk
42+
image_name: golang-adk
43+
tag_suffix: ""
44+
- build_target: golang-adk-full
45+
image_name: golang-adk
46+
tag_suffix: "-full"
3547
runs-on: ubuntu-latest
3648
services:
3749
registry:
@@ -67,15 +79,12 @@ jobs:
6779
--push
6880
run: |
6981
export VERSION=${{ steps.vars.outputs.version }}
70-
make build-${{ matrix.image }}
82+
make build-${{ matrix.build_target }}
7183
working-directory: ./
72-
- name: Load image versions
73-
id: image-versions
74-
run: make build-img-versions
7584
- name: Image vulnerability scanner
7685
uses: aquasecurity/trivy-action@0.35.0
7786
with:
78-
image-ref: localhost:5001/kagent-dev/kagent/${{ matrix.image }}:${{ steps.vars.outputs.version }}
87+
image-ref: localhost:5001/kagent-dev/kagent/${{ matrix.image_name }}:${{ steps.vars.outputs.version }}${{ matrix.tag_suffix }}
7988
severity: 'CRITICAL,HIGH'
8089
ignore-unfixed: true
8190
exit-code: '1'

CODEOWNERS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* @EItanya @peterj @ilackarms @yuval-k
2-
python/ @EItanya @peterj @yuval-k
2+
python/ @EItanya @peterj @yuval-k @supreme-gg-gg @iplay88keys @jmhbh
33
go/ @EItanya @ilackarms @yuval-k
44
ui/ @peterj
5-
helm/ @EItanya @ilackarms @yuval-k
5+
helm/ @EItanya @ilackarms @yuval-k @supreme-gg-gg @iplay88keys @jmhbh
6+
go/adk/ @supreme-gg-gg
7+
go/core/ @supreme-gg-gg @iplay88keys @jmhbh
8+
go/api/ @supreme-gg-gg @iplay88keys @jmhbh

docker/skills-init/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,17 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /build/krane .
1414

1515
FROM alpine:3.23
1616

17+
ARG PYTHON_UID=1001
18+
ARG PYTHON_GID=1001
19+
1720
RUN apk upgrade --no-cache && apk add --no-cache git
1821
COPY --from=krane-builder /build/krane /usr/local/bin/krane
22+
23+
# Run as the same UID/GID as the main agent container (python user) so that
24+
# files written to the shared /skills volume are readable by the main container.
25+
# Keep these defaults aligned with the canonical main agent image definition
26+
# (for example, python/Dockerfile) to avoid UID/GID drift across images.
27+
RUN addgroup -g ${PYTHON_GID} pythongroup && \
28+
adduser -u ${PYTHON_UID} -G pythongroup -s /bin/sh -D python
29+
30+
USER ${PYTHON_UID}:${PYTHON_GID}

go/Dockerfile.full

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ RUN --mount=type=cache,target=/var/cache/apk,rw \
2929
apk add --no-cache \
3030
bash git ca-certificates nodejs npm node-gyp bubblewrap python-${TOOLS_PYTHON_VERSION} libstdc++
3131

32+
# Keep the pinned sandbox-runtime revision, but replace its vulnerable locked lodash-es version.
3233
RUN --mount=type=cache,target=/root/.npm \
3334
mkdir -p /opt && \
3435
cd /opt && \
3536
git clone --depth 1 --revision=ef4afdef4d711ba21a507d7f7369e305f7d3dbfa https://github.com/anthropic-experimental/sandbox-runtime.git && \
3637
cd sandbox-runtime && \
37-
npm install && \
38+
npm install --save-exact lodash-es@4.18.1 @types/lodash-es@4.17.12 && \
3839
npm run build && \
3940
npm prune --omit=dev
4041

@@ -45,11 +46,6 @@ RUN --mount=type=cache,target=/var/cache/apk,rw \
4546
apk add --no-cache \
4647
bash ca-certificates curl nodejs bubblewrap socat python-${TOOLS_PYTHON_VERSION} ripgrep libstdc++
4748

48-
# Make bwrap setuid-root so it can create user/network namespaces when invoked
49-
# by non-root users on hosts with kernel.apparmor_restrict_unprivileged_userns=1
50-
# (Ubuntu 23.10+). See https://github.com/openai/codex/issues/14919
51-
RUN chmod u+s /usr/bin/bwrap
52-
5349
RUN addgroup -g 1001 goagent && \
5450
adduser -u 1001 -G goagent -s /bin/bash -D goagent
5551

go/adk/pkg/agent/agent.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,10 @@ func CreateLLM(ctx context.Context, m adk.Model, log logr.Logger) (adkmodel.LLM,
285285
}
286286
// Use Bedrock Converse API for ALL models (including Anthropic)
287287
cfg := &models.BedrockConfig{
288-
TransportConfig: transportConfigFromBase(m.BaseModel, nil),
289-
Model: modelName,
290-
Region: region,
288+
TransportConfig: transportConfigFromBase(m.BaseModel, nil),
289+
Model: modelName,
290+
Region: region,
291+
AdditionalModelRequestFields: m.AdditionalModelRequestFields,
291292
}
292293
return models.NewBedrockModelWithLogger(ctx, cfg, log)
293294

go/adk/pkg/models/bedrock.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ type BedrockConfig struct {
7676
MaxTokens *int
7777
Temperature *float64
7878
TopP *float64
79-
TopK *int
8079
AdditionalModelRequestFields map[string]any
8180
}
8281

@@ -208,6 +207,17 @@ func (m *BedrockModel) GenerateContent(ctx context.Context, req *model.LLMReques
208207
}
209208
}
210209

210+
// buildAdditionalModelRequestFields returns a document.Interface containing
211+
// model-specific parameters that are not part of InferenceConfiguration.
212+
// The raw map is forwarded as-is to the Bedrock Converse API.
213+
// Returns nil when no extra fields are configured.
214+
func (m *BedrockModel) buildAdditionalModelRequestFields() document.Interface {
215+
if len(m.Config.AdditionalModelRequestFields) == 0 {
216+
return nil
217+
}
218+
return document.NewLazyDocument(m.Config.AdditionalModelRequestFields)
219+
}
220+
211221
// generateStreaming handles streaming responses from Bedrock ConverseStream.
212222
// It properly handles both text and tool use content blocks during streaming.
213223
// reverseNameMap maps sanitized Bedrock tool names back to their original names.
@@ -369,16 +379,6 @@ func (tc *streamingToolCall) parseArgs() map[string]any {
369379
return args
370380
}
371381

372-
// buildAdditionalModelRequestFields returns a document.Interface containing
373-
// model-specific parameters that are not part of InferenceConfiguration.
374-
// Returns nil when no extra fields are configured.
375-
func (m *BedrockModel) buildAdditionalModelRequestFields() document.Interface {
376-
if len(m.Config.AdditionalModelRequestFields) == 0 {
377-
return nil
378-
}
379-
return document.NewLazyDocument(m.Config.AdditionalModelRequestFields)
380-
}
381-
382382
// generateNonStreaming handles non-streaming responses from Bedrock Converse.
383383
// reverseNameMap maps sanitized Bedrock tool names back to their original names.
384384
func (m *BedrockModel) generateNonStreaming(ctx context.Context, modelId string, messages []types.Message, systemPrompt []types.SystemContentBlock, inferenceConfig *types.InferenceConfiguration, toolConfig *types.ToolConfiguration, additionalFields document.Interface, reverseNameMap map[string]string, yield func(*model.LLMResponse, error) bool) {

go/api/adk/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ type Bedrock struct {
247247
BaseModel
248248
// Region is the AWS region where the model is available
249249
Region string `json:"region,omitempty"`
250+
// AdditionalModelRequestFields passes model-specific parameters to Bedrock's
251+
// additionalModelRequestFields in the Converse API. Use this for provider-specific
252+
// options outside the standard InferenceConfiguration block.
253+
AdditionalModelRequestFields map[string]any `json:"additional_model_request_fields,omitempty"`
250254
}
251255

252256
func (b *Bedrock) MarshalJSON() ([]byte, error) {

go/api/config/crd/bases/kagent.dev_agents.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10216,8 +10216,10 @@ spec:
1021610216
skills from.
1021710217
properties:
1021810218
name:
10219-
description: Name for the skill directory under /skills.
10220-
Defaults to the repo name.
10219+
description: |-
10220+
Name for the skill directory under /skills. If omitted, defaults to the last
10221+
segment of Path when Path is set; otherwise defaults to the repo name (last
10222+
URL path segment, without .git).
1022110223
type: string
1022210224
path:
1022310225
description: Subdirectory within the repo to use as the

0 commit comments

Comments
 (0)