Merged
Conversation
Design plan for surfacing agent contracts and live assembled context in clawdash via claw-api. Covers cllama snapshot capture, new API endpoints, credential redaction, dashboard principal, and scope model. Reviewed through two rounds of Codex review (9 findings addressed).
Adds end-to-end agent context inspection: operators can see each agent's compiled contract (AGENTS.md, CLAWDAPUS.md, feeds, tools, memory) plus the live system message cllama assembled for the most recent turn. - cllama: bumps submodule to capture a ContextSnapshot per agent and expose it via two internal UI endpoints. - claw-api: new agent.context verb and three endpoints that read contract artifacts from the mounted context dir and proxy live snapshots from cllama. Credentials in metadata/feeds/tools/memory are recursively redacted before serving. - clawdash: new /agents index and /agents/<id> detail page with contract + live-context tabs. Minimalist live layout — the assembled system message is the hero, dynamic inputs render as a tagged ordered list, supporting data lives in <details>. - claw up: injects CLAW_CLLAMA_API_URL/TOKEN and the context-dir mount into claw-api; always creates a claw-dashboard principal so the Agents UI works on every pod with claw-api (previously only pods with invoke entries). Emits the dashboard URL on success. - audit: switches ParseReader to bufio.Reader so large context events no longer trip the 1 MiB Scanner token limit. Closes #172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
End-to-end agent context visibility in clawdash. Operators can now see what each agent was compiled with, plus the exact system message cllama assembled for the most recent turn — captured from the real request flow, not reconstructed.
What's in scope
cllama (submodule bump to
mostlydev/cllama#issue-agent-context-visibility):ContextSnapshotstruct +sync.Mapper-agent store, captured after the real injection pipeline (memory recall → feeds → time → tools → model resolution) as a side effect of normal requestssystempreserved as string-or-block-array; managed-tool turns updateTurnCounton loop completionGET /internal/contextandGET /internal/context/<id>/snapshotclaw-api:
agent.contextverb + three endpoints:GET /agents,GET /agents/<id>/contract,GET /agents/<id>/contexttoken,auth, andsecretfields across metadata/feeds/tools/memory/service-auth before servingclaw-api: selfprincipals can reach their own service's agentsCLLAMA_UI_TOKENclawdash:
/agentsindex and/agents/<id>detail page with Contract / Live tabs (nav link integrated across existing pages)captured · format · requested → resolved), the assembled system message as the hero, dynamic inputs as a tagged ordered list with a cyan left rail (feed/memory/time/intervention). Supporting data (recent captures, tool schemas, raw snapshot) lives behind<details>claw up:
.claw-runtime/context/into claw-api and injectsCLAW_CLLAMA_API_URL/CLAW_CLLAMA_API_TOKENclaw-dashboardprincipal when claw-api is injected, so the Agents UI works on every pod with claw-api (not just pods with invoke entries as before)[claw] dashboard: http://localhost:8082audit:
ParseReaderswitched frombufio.Scannertobufio.Reader— large context events no longer trip the 1 MiB token limitReview notes
Design went through two rounds of Codex review before implementation — 9 findings addressed in the plan, then implemented. Design doc:
docs/plans/2026-04-17-agent-context-visibility-design.md.Closes #172
Test plan
go test ./...greengo vet ./...clean