-
Notifications
You must be signed in to change notification settings - Fork 3
dependency_update_failure
When modifying code in the sibling module ../multi-llm-provider-go (e.g., adding debug logs, fixing bugs in Azure adapter), the changes are not reflected in the deployed mcp-agent container, even when using go.work and local builds.
- Added
[AZURE_PATCH_V5_ACTIVE]log toazure_adapter.go. - Redeployed using
./deploy.sh agent --local. - Logs showed
Initialized Azure AI LLMbut missing the patch logs. - Health check showed
status: healthybut no indication of the new code version.
A sibling module needs a replace directive. go.work does not affect a
module build, and none of the Docker or Go-cache theories below are needed to
explain it.
Hit twice in one day and diagnosed both times only after the symptom recurred:
- A fix was written in
multi-llm-provider-go(codex adapter teardown), verified by its own tests, and had no effect on the running server.agent_go/go.modpinned the tagged version, so the build resolved from the module cache and never saw the working tree. - The identical thing happened again hours later with
mcpagent.
The fix is one line per sibling:
replace github.com/manishiitg/multi-llm-provider-go => ../../multi-llm-provider-go
replace github.com/manishiitg/mcpagent => ../../mcpagent
Verify resolution rather than assuming, since a build against the wrong source succeeds and looks identical:
go list -m -f '{{.Path}} -> {{.Dir}}' github.com/manishiitg/mcpagent
# want: -> /Users/…/mcpagent not a path under $GOMODCACHEAnd confirm the change actually linked, which is what finally settled it both times — a distinctive string from the new code:
strings <binary> | grep -c "some new log line"Both replaces are temporary and should be dropped when the modules are tagged;
agent_go/go.mod carries a comment saying so.
Generalizable lesson: a build against stale sources produces no error, no warning, and a healthy process. Two hours were lost to "the fix doesn't work" when the fix was never in the binary. Before debugging why a change had no effect, verify the change is present in the artifact.
The below concerned container deployment and was never confirmed. The local-build cause above is proven; if the container case recurs, start by applying the same "is it actually in the binary" check before pursuing Docker-layer theories.
-
Docker Build Context: The
Dockerfile.agentcopiesmulti-llm-provider-go/but might be caching theCOPYlayer if the file modification timestamps aren't propagated or ifgo buildis hitting a cached intermediate layer that ignores the new files. -
Go Cache:
go buildinside the container might be using a cached module state ifgo.workisn't fully respected or ifgo.modsums match (even if code changed). - Orphaned Containers: Azure Container Apps might be rolling back to a previous healthy revision if the new one fails startup checks (though logs suggest it started).
To definitively prove which code is running:
- Add a
const VERSIONstring inmulti-llm-provider-go/llmtypes/version.go. - Update
agent_go/cmd/server/server.goto importllmtypesand includellmtypes.VERSIONin the/api/healthresponse. - Increment this version string on every significant patch.
- Check
/api/healthafter deployment. If the version matches, the code is present.
- Force cache bust by modifying
multi-llm-provider-go/go.mod(adding a comment) before build. - Ensure
deploy.sheffectively cleans or ignores Docker cache for the relevant layers.
Auto-synced from docs/ on main. Edit there, not here.