Repository navigation
Fix secret leak via repo-local config, confine tools, fail on cut-off answers - #14
Merged
Merged
Conversation
…sses - A ./.clank/config.toml found in the working directory may only name each section's own key variable (CLANK_API_KEY, BRAVE_API_KEY, TAVILY_API_KEY); another name needs --config or CLANK_CONFIG. A cloned repo could otherwise send any environment secret to an endpoint it also chose. - clank-jev no longer takes its endpoint, model or key from [clank]; only [clank].timeout. The chat base_url was being used as the Jev URL. - Tool paths are confined to the working directory; read_file refuses non-regular files and files over 4 MB, and counts lines like wc. - A stream that ends without finish_reason or [DONE] is a failure (exit 1); non-JSON and error events mid-stream are reported, not skipped. - A -c context tree whose file leaf cannot be read fails the run instead of sending "[context error: ...]" to the model; a node with file plus text/children is rejected. - clank-web --fetch drops a character split by the 512 KiB cap instead of failing the whole page. - stat reports symlinks, search stops at exactly 500 matches, invalid tool arguments come back to the model as an error, a trailing slash in base_url works, credentials in base_url are redacted from traces and errors, --show-thinking prints no stray blank line, clank-jev checks --min-prob. - The pre-push hook says that it sends diffs to a third-party provider. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RkP7NfSreh9VQeWSk47hb
makefunstuff
marked this pull request as ready for review
September 29, 2026 17:19
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.
Requested by j · project thread
Before: a cloned repo's
./.clank/config.tomlcould setbase_urlplusapi_key_env = "GITHUB_TOKEN", andclank -m hisent that token to the repo's server (reproduced).clank-jevsent your Jev key to[clank].base_url. The model'sread_filecould read~/.sshor/dev/zero. A stream the server dropped mid-answer exited 0, and a-ctree with a missing file sent[context error: …]to the model and exited 0.clank-web --fetchfailed on large pages when the 512 KiB cap split a UTF-8 character.After: a working-directory config may only name
CLANK_API_KEY/BRAVE_API_KEY/TAVILY_API_KEY(any other variable needs--configorCLANK_CONFIG, else exit 2).clank-jevreads only[clank].timeout. Tool paths must resolve inside the working directory, andread_filetakes regular files up to 4 MB. Cut-off streams, non-JSON stream events and unreadable context leaves all exit 1. Fetch drops the split character.Smaller fixes:
statreports symlinks,searchstops at exactly 500 matches,read_filecounts lines likewcand drops\r, invalid tool-call JSON is returned to the model as an error, a trailing/inbase_urlworks,user:key@inbase_urlis redacted from traces and errors,--show-thinkingprints no stray blank line,clank-jev --min-probmust be in 0..=1. The pre-push hook now says it sends diffs to a third party.How:
config::loadchecks key-variable names for implied files only.tools::executecanonicalizes and confines every path.client::stream_roundrequiresfinish_reasonor[DONE].Tree::renderreturnsResult. Docs (PROTOCOL.md, docs/clank-jev.md, docs/clank-web.md, STATUS.md) are updated and reflowed. New unit and stub-server tests cover each fix;cargo test --lockedpasses with-D warnings.Not changed: the top-level
json_schemarequest field (llama.cpp-specific) and the stdin read when stdin is an open non-TTY. Both need a design decision rather than a bug fix.🤖 Generated with Claude Code
https://claude.ai/code/session_019RkP7NfSreh9VQeWSk47hb
Generated by Claude Code