feat(build): add a debug target that outputs the rendered agent.yaml
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- docker, go
- Domain
- build-system, devtools
Research direction
A linked pull request (#67) is already open, so check its status before starting. The issue points to pkg/build/router.go, pkg/build/build.go, pkg/agentkit/abi/render.go, and pkg/build/build_test.go; begin by reading the existing routing and handleAgent flow. Done means the debug target writes agent.yaml matching the image output without downloading the runtime image, works across runtimes and with context instructions, and is documented.
Written by the indexing model from the issue text.
Description
Problem
AgentKit turns your Agentkitfile into a file at /agent/agent.yaml inside the image. Along the way it:
- reads your instructions file;
- fills in defaults such as the port and runtime;
- copies over tools, env names and context providers.
When an agent doesn't behave as expected, the first question is often "what did my file turn into?" Today the only way to find out is to:
- build the full image, which downloads the runtime image (hundreds of MB);
- read the file out of that image;
- or read the Go code.
dalec solves the same problem with debug build targets. debug/resolve outputs the final spec without building anything else (see dalec's frontend/debug/).
What
Add a build target that writes only the rendered file:
docker buildx build -f agentkitfile.yaml . \
--target debug/agent-yaml \
--output type=local,dest=./out
# writes ./out/agent.yaml
- Same file. The output must match
/agent/agent.yamlin the image byte for byte. - Fast. It doesn't download the runtime image.
- Same build args. It accepts the same build args as an image build, such as
--build-arg runtime=.... - Listed. It shows up in
docker buildx build --call targets(#58).
Out of scope
- Other debug outputs, such as the image settings or the agent manifest from #55. They can be added the same way later, for example
debug/image-config.
Why
- Quick answers when debugging: see exactly what the runtime will read.
- No need to build, download, or open the image.
- It's also useful for reviewing changes: compare the rendered output before and after an edit.
How
Where things are
| File | What it does |
|---|---|
pkg/build/router.go |
The routes and contextRouteHandlers maps. registerRuntime() adds <runtime>/image. lookupRoute() matches an exact target name first. |
pkg/build/build.go |
handleAgent() resolves the instructions (resolveInstructionSource), builds the build-ready agent (effective.FromConfig) and then builds the image. |
pkg/agentkit/abi/render.go |
abi.Render(agent) returns the exact bytes of /agent/agent.yaml. |
pkg/build/build_test.go |
fakeBuildClient, for tests that don't need a real BuildKit. |
Steps
- Share the setup. Pull the "config → resolved instructions → build-ready agent" part of
handleAgent()into a shared function, so the image build and the debug target can't drift apart. - Add a handler for
debug/agent-yaml.- Use the shared function, then call
abi.Render. - Put the bytes in an empty filesystem:
llb.Scratch().File(llb.Mkfile("agent.yaml", 0o644, data)). - Solve it with
c.Solveand return the result. Don't add image settings; this output is files, not an image.
- Use the shared function, then call
- Register the route in both
routesandcontextRouteHandlers. Instruction files are read from the build context, so the handler needs the context reader. - Check the routing.
lookupRoute()should finddebug/agent-yamlby exact match, and the runtime-mismatch check (targetRuntimeSegment) must not reject it, becausedebugisn't a runtime name.- Add tests for both, for every runtime.
Tests
- With
fakeBuildClient, targetdebug/agent-yaml:- returns one file,
agent.yaml, whose bytes equalabi.Renderfor the same input; - doesn't download the runtime image.
- returns one file,
- It works with an instructions file (
instructions: {file: ./prompt.md}) read from the build context. - Routing works for each runtime, including aliases such as
maf. - End to end:
- build an image from
test/agentkitfile-tools.yaml; - run the debug target on the same file;
- compare the output with
/agent/agent.yamlfrom the image.
- build an image from
Run:
go test ./...
make lint
Docs
docs/agentkitfile.md: add a short "See what your file turns into" section with the command. Note that it needs--output type=local.
Done when
- The command above writes
agent.yaml, identical to the file in the image, without downloading the runtime image. - It works for every runtime and with instruction files.
- It appears in
--call targetsonce #58 lands. - It's documented.
- Dominant language
- Python
- Stars
- 7
- Forks
- 5
- Avg merge
- 3h 39m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from orka-agents/agentkit
-
fix(pydantic-ai): CI fails with newest pydantic-ai (unexpected 'history' argument)Possibly taken @gambtho claimed this 30 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
orka-agents/agentkit#77 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
orka-agents/agentkit#76 · 3 comments ·
-
area/build area/orka area/runtime blocked enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
orka-agents/agentkit#69 ·
-
area/build area/orka area/runtime enhancement
Difficulty 4/5 3-5 days Newbie friendliness 68/100
orka-agents/agentkit#68 ·
-
area/build enhancement testing
Difficulty 5/5 Over a week Newbie friendliness 42/100
orka-agents/agentkit#65 ·
All issues in orka-agents/agentkit
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 62/100
DaoCloud/DaoCloud-docs#7839 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
sav-oss-org/ptusa_main#1610 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug status/accepted type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/apm#4925 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sagemathinc/sagebrush#1701 ·
Maintainers usually reply within 1 day