feat(build): add a debug target that outputs the rendered agent.yaml
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- docker, go
- Ambito
- build-system, devtools
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 7
- Fork
- 5
- Merge medio
- 3h 39m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di orka-agents/agentkit
-
fix(pydantic-ai): CI fails with newest pydantic-ai (unexpected 'history' argument)Forse già presa @gambtho l’ha presa 30 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
orka-agents/agentkit#77 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
orka-agents/agentkit#76 · 3 commenti ·
-
area/build area/orka area/runtime blocked enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
orka-agents/agentkit#69 ·
-
area/build area/orka area/runtime enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
orka-agents/agentkit#68 ·
-
area/build enhancement testing
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
orka-agents/agentkit#65 ·
Tutte le issue di orka-agents/agentkit
Issue simili
-
bot-triaged module: correctness (silent) module: fft triage review
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Remove Python pin in recipeAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
conda-forge/zarpaint-feedstock#8 · 1 commento · 1 reazione ·
-
plot_prediction colorbar shows a 0-1 range instead of the data rangeForse già presa @nikhil3495 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
mllam/neural-lam#902 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
didi/helixharness#28 ·
I maintainer di solito rispondono entro 1 giorno
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Apertaenhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
DaoCloud/DaoCloud-docs#7839 ·
I maintainer di solito rispondono entro 1 giorno