Adds plugin-catalog/scribase.yaml, pinned to caelum0x/scribase-hermes-plugin
@ 77641be477430b83a082406cdf7c6dbb7037e6ca. Registers one tool,
scribase_create_project, that provisions a hosted Postgres backend project
on Scribase (api.scribase.com) via its public REST API.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The background review thread runs with the finished turn's ContextVars
(propagate_context_to_thread), so it inherits the session owner's
turn-scoped secret prompt. When the review opened a skill whose required
env var is missing (skill_view of the bundled linear skill without
LINEAR_API_KEY), the masked "Enter value for ..." panel popped up on the
user's screen after the turn had already ended, and the review waited up
to the 120s prompt deadline for an answer.
The review already resolves dangerous-command approvals to "deny" without
asking anyone. Give it the matching secret capture: bind a non-interactive
callback for the review fork that reports the setup as skipped. The bound
ContextVar wins over both the turn's viewer prompt and the classic CLI's
process-global callback, and /refine reviews take the same path.
Delta review of 73c68b21330 (P3): widening the code-template test to
cover interpolations also exempted brace literals that open with a
letter or digit, so a code-mode read of appsettings.json left
PWD={P@ssw0rd!}, {Tr0ub4dor&3} and {9f$kL2@pq} readable (main leaks
them too). A template slot never contains @ $ & #, or a ! other than
a !r/!s/!a conversion, so those characters now mark an ODBC literal.
Every interpolation from the previous round ({os.environ['DB_PASS']},
{get_pw()}, {pw!r}, {pw!s:>10}, {1:s}) stays as written.
Still unmasked in code reads, as on main: a brace literal made only of
identifier characters ({hunter2-Secret.99}), which can't be told apart
from {cfg.secret_name}.
Delta review of 10680b3d15a found:
- The whole-value lookahead added for PROXY_DEST rejected a Basic pair
whose quote opens before the NAME, so "MY_PROXY_BASIC=user:pw" in a
YAML list, a JSON/Python array or a single-quoted string leaked again
in force mode. Closing quotes, ] and } and a backtick now end the
value too; a / still does not, so PROXY_DEST keeps its path.
- The ODBC template test accepted only bare identifiers, so code reads
(cat app.py) masked f-string and C# interpolations:
{os.environ['DB_PASS']}, {config["Db:Password"]}, {get_pw()},
{pw!r}, { pw }, {1:s}. A brace opening with a digit or identifier
and carrying no ; or nested brace is a template now. {Zq7x;LmP2},
{abc}}def} and {#...} still count as ODBC literals and are masked.
The new cases fail on 10680b3d15a and pass here.
Fixes three review-bot findings on 500d5e91cfb:
- A braced ODBC password read from a file stayed readable:
redact_terminal_output("Server=db;UID=app;PWD={Zq7x;LmP2};...",
"cat appsettings.json") runs with code_file=True, and the template
exemption took {Zq7x;LmP2} for a format slot. On a ;-delimited line
only a format slot ({0}, {pw}, {db.password}) or ${VAR} counts as a
template now, so ODBC's literal braces are masked.
- Affixed JSON keys missed escaped JSON: a tool result wrapping a config
dump ({"output": "{\"DB_PASSWORD\": \"...\"}"}) and a value carrying
an escape ("s3cret\\value"). An escaped twin of the affixed-key
matcher shares the same key policy, and the value grammar now
consumes \x escape pairs.
- The force-only NAME=user:pass rule matched a prefix of the value, so
PROXY_DEST=buildhost:Release2026/artifact.tar lost its path. The pair
must now be the whole value.
The new tests fail on 2e34be9dc4a and pass here.
Independent review of 500d5e91cfb found three classes of ordinary output
that the new rules started masking:
- NAME=user:pass ran on any NAME, so force-mode callers (process output,
session history, approval and MCP paths) turned IMAGE=redis:7-alpine,
BRANCH=origin:feature-login2, LS_COLORS and Server=tcp:db,1433 into
NAME=x:***. The rule now needs a NAME that says it holds a Basic pair
(auth, basic, cred, login, proxy, userpass, userinfo):
MY_PROXY_BASIC=user:pw and PROXY_CREDS=bob:pw are still masked.
- JSON keys that contain a secret word but don't end in one are metadata
about it: passwordChanged, password_expires_at, password_policy,
tokenUrl, secret_id, secret_arn and PASSWORD_STORE_DIR carry
timestamps, URLs and ids, and the opaque-value test let those through.
Only keys that end in the credential word (an optional _value suffix
aside) are masked now, and a true/false/null answer to has_password
is left alone.
- URL userinfo masked templates and docs samples outside code files:
f"https://{user}:{pw}@host", user:{password}@ and
"https://user:password@host" now stay as written everywhere.
Smaller fixes in the same files: a quoted Helm/Jinja template
(password: "{{ .Values.pw }}") stays readable, and "the pwd= flag and
host= flag" is no longer read as a conninfo field. "password = x" with
spaces on both sides still is.
All three leak families from the PR still mask. The new keep-cases fail
on 500d5e91cfb (11 of them) and pass here. The worst adversarial timing
is 0.28 s on 200k characters (9,000 JSON *_token keys).
test_browser_exec_child_environment had the probe child print its whole
environment and read it back from browser_exec's output. That output goes
through secret redaction, and this branch now masks JSON keys that
contain a secret word, so "BROWSER_USE_API_KEY": "bu-key" came back as
"***" and the assertion failed on the macOS and Windows lanes.
The test checks what the child receives, not what the output shows. The
probe now writes its view to a file and the test reads it from there.
The assertions are unchanged.
The separate after-separator pass doubled the cost of a 200k `-sk-` /
`_ghp_` flood. Fold it into the masking scan (lookbehind `(?<![A-Za-z0-9])`
admits a `-`/`_` before the prefix, the callback keeps a glued match only
when its body is opaque) and group the alternation by first char so each
candidate position is rejected in one step. The opaque-body test walks
16+ char alnum runs with finditer instead of splitting the whole match.
The salvaged PRs added ~400 test lines across test_redact.py and two new
files. Keep one masked + one kept-readable case group per family, in both
the head/tail and the non-reusable sentinel mode, in a new file so
tests/agent/test_redact.py stays under its size cap. The only edit left in
test_redact.py is the userinfo contract flip from #125680.
Co-authored-by: r266-tech <r2668940489@gmail.com>
Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
Co-authored-by: Mark <mark@mtp44.net>
Co-authored-by: arbianshkodra <arbianshkodra@users.noreply.github.com>
No behaviour change. The ADO.NET/ODBC/libpq scanner from the previous
commits is self-contained; moving it keeps agent/redact.py under the
2,000-line file cap.
Fixes#147240 families 2 and 3.
`{"API_TOKEN": "..."}`, `{"DB_PASSWORD": "..."}`, `{"client_secret": "..."}`
leaked because _JSON_FIELD_RE only matches a closed key list, while the
ENV and YAML passes accept affixes. A second JSON pass now takes any
identifier-shaped key, applies the YAML word set at a word boundary plus
the shared assignment gate, and for keys that do not END in a credential
word (`password_policy`, `secret_ref`) masks only opaque values, the
is_secret_field_name policy.
`backup-sk-...`, `backup_sk-...` and `x-ghp_...` leaked because the
prefix matcher's lookbehind rejects `-`/`_` (so `scikit-learn` stays
whole). A separate after-separator matcher keeps the known-prefix +
length shape and additionally requires a 16+ char mixed-class run in
the body, so `backup-sk-learn.txt` and `deploy-sk-prod-deployment-01`
stay readable.
The userinfo and NAME=user:pass passes masked `https://user:${TOKEN}@host`,
`https://user:<password>@host`, `MY_BASIC=user:${PASSWORD}` (docs samples
main keeps readable for DSNs via _DSN_PW_PLACEHOLDER_RE) and
`TAG=myrepo:latest-release` (a lower-case word tag, never a password).
The force-only NAME=user:pass rule (#125664) matched single-letter users, so
SRC=C:\Users\admin\Documents\report.pdf collapsed to SRC=C:*** at persistence
boundaries — unrecoverable data loss on a written-back .env. The same pass ate
CHECKSUM=sha256:<hex> digests (#125680 review).
- the user half now needs >=2 characters: a single-letter user: is a Windows
drive; a secret-keyword NAME still masks via the ENV pass on every path
- a known hash-algorithm name as the user half (sha256:1234..., ubuntu@sha256:...)
marks an algorithm:digest, not a credential
The force-only NAME=user:pass pass destroyed stored values that merely
look colon-y: an ISO timestamp with a fraction (TS=...T12:00:00.123456Z
lost its tail), a letter-bearing image tag (IMAGE=ubuntu:24.04-noble) and
a registry reference (TARGET=registry.example.com:5000/repo lost host,
port and path) — data loss at the persistence boundary, not display.
The password group is now a single token (no '/', ':' or '@'), so a
timestamp tail truncates to digits and a registry path stays whole, and
digit-led dotted version tails (24.04-noble, v1.2.3-alpine) are rejected
outright. '@' no longer ending up in the group also lets a
user:{pw}@host value keep its pure brace expression, to which the
promised #33801 f-string template exemption is now actually applied
(code_file), matching _redact_userinfo_passwords.
The userinfo password is masked on every path — #34029's pass-through
was about query-string round-trip tokens (magic links / OAuth callbacks
live in the query, never in userinfo), the same reasoning #6396 used
for the bare-token form; code_file keeps f-string {…} templates intact
(#33801's rule). NAME=user:pass pairs under innocuous names are masked
force-only with an 8-char letter-bearing floor, so the issue's negative
controls (host:port, scheme URLs, ISO timestamps, image tags) stay
untouched on every path.
Key patterns now start at the key name behind a fixed-width lookbehind;
the old (?:^|[;\s])\s* prefix rescanned whitespace runs from every offset
(16K spaces before password= took ~30s). Value extents come from a
non-backtracking scanner per grammar: ODBC braces with }} escapes,
ADO.NET doubled quotes, libpq backslash escapes and bare ';' inside
libpq values. One companion-key scan per line.
Reported by @Tsury.
The word-boundary key rule means PGPASSWORD, MYSQL_PWD and SSHPASS never
count as password keys (the keyword is glued onto a prefix), so export,
env dumps, docker -e and systemd Environment= lines leaked them verbatim.
Treat those exact names as credential keys. Bare PWD/OLDPWD (cwd) and
PGPASSFILE (a path) are unchanged.
libpq's space-delimited conninfo (psql "host=db password=x") had no ';'
and skipped the keyword/value connection-string pass. Accept it when the
line carries a companion connection key; an unquoted value ends at
whitespace.
agent/redact.py validates assignment keys with _has_word_bounded_keyword,
which needs the secret keyword to both START and END on a word boundary
(so `Secretary:` / `tokenizer:` prose is left alone). That also passes
concatenated credential keys in clear: on main `dbpassword: hunter2xyz`,
`dbpassword=hunter2xyz`, `rootpasswd: s3cr3t` and
`app.dbpassword=hunter2xyz` are returned unchanged with force=True.
No prose word ends in `password` / `passwd`, so for those two keywords
only the END boundary is required (_has_password_keyword), and such keys
are password-class: any literal value is masked, as for `db_password`.
`passwordless: enabled` stays readable; all other keywords keep the
two-sided boundary.
4 new concatenation cases fail on main and pass here (the camelCase
`mysqlPassword` already passed); the `passwordless` negatives pass on
both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The quoted-scalar YAML pass masked `password: ""`, `api_key: "<your key>"`
and `api_key: "${API_KEY}"`, which main kept readable (the JSON pass skips
an empty value and _redact_db skips the same placeholder shapes). Reuse
_DSN_PW_PLACEHOLDER_RE so docs samples and env refs stay visible.
quoted values, deferring to _JSON_FIELD_RE -- but that rule requires a
quoted KEY, which bare-key YAML never has, so quoted scalars such as
`password: "secret"` / `api_key: "ak_live_..."` leaked verbatim with
redaction on by default (special-char passwords are forced to be quoted
in YAML, so the highest-risk values were exactly the skipped ones).
Drop the lookahead and match either a quoted scalar or an unquoted
token. The quoted alternatives are escape-aware (double-quote \", single
-quote doubling ''), bounded to a single line (LF and CRLF), and
fail-closed for an unterminated quote (masked to end-of-line). _redact_yaml
masks the inner secret while preserving the wrapping quotes; the prose and
URL carve-outs are unchanged. Adds regression tests.
The session-end reaper (78eff4628a, #106742) found leftover processes by
reading /proc/<pid>/environ, so on macOS it scanned nothing. There, e2e
tests that make a client start its own gateway (e.g. the C7 two-tenant
Desktop backend) leave a `gateway run --idle-exit` daemon running as a
launchd job, outside the pytest process tree. The test homes configure
an API server, so the gateway's idle exit keeps reporting
"messaging ['api_server']" and the daemon never exits: ~320 MB per run.
One dev Mac had 22 of them, 11-26 h old.
Read each process's exec-time environment through psutil on every POSIX
host instead, and run the reaper's own test on macOS. That test times
out on base on macOS and passes here; a real C7 run leaves no gateway
behind afterwards.
The route identity read a provider entry's context pin only for a task that names the entry. A task with `provider: custom` and its own `base_url` returned early, but the probe still reads the pin of the entry at that URL, so lowering only that pin (900K to 80K) left a warm agent's trigger on the old window. The identity now carries the pin for the route's own URL too.
Reported-by: greptile-apps[bot]
A failure cooldown recorded for a retired summariser kept compression paused after the route moved to a working replacement (almost 300s in the reproduction), because nothing cleared it when only the side-task route changed. A detected route move now clears the cooldown through the compressor's own clear (in memory and in the session row), and preflight checks the route before it reads the cooldown, so the same pass can compress.
Reported-by: helix4u
The latch read the compression route after the probe, so an edit that landed while the probe ran was recorded as measured and the next request skipped re-probing. Each latching path now reads the route first and records that one.
Reported-by: helix4u
The compression route identity recorded the task block and a named entry's URL and default model, but not the context_length pin the probe reads for that model. Lowering only that pin (a replacement summariser on the same endpoint, 900K to 80K) left a warm agent's trigger on the old window. The identity now carries the pin get_custom_provider_context_length resolves for the compression model at the entry's URL. The regression drives the warm path through ensure_compression_feasibility_checked.
Reported-by: helix4u
The probe-timing functions moved to conversation_compression_feasibility.py but stayed re-exported from conversation_compression.py, against the AGENTS.md rule that internal moves get no re-export shim. Callers (route_binding, agent_runtime_helpers, chat_completion_helpers, turn_preflight) and the feasibility tests now import them from the new module, and the moved names leave conversation_compression's __all__. No behaviour change.
Reported-by: greptile-apps[bot]
Measuring the compression model read the profile's providers: entries even inside a --safe-mode or --ignore-user-config chat, the one remaining place such a chat consulted the profile. Inside a bypass session the probe now uses the entries captured at agent start.
Reported-by: unsupportedpastels
A --safe-mode or --ignore-user-config chat got an empty auxiliary section, so the built-in per-task defaults (vision's 120s timeout, goal_judge's 60s, voice_chat's reasoning setting) fell back to the 30s client default. Its side tasks now use the session's own saved section, which holds code defaults only, so the profile is still never read. The bypass test asserts the vision timeout inside a bypass policy_scope.
Reported-by: unsupportedpastels
The feasibility probe passed the provider entries captured at agent start, so a per-model context_length pin edited later (a replacement summariser on the same endpoint) was ignored and the old pin set the compression trigger. The probe now reads the entries from config.yaml, falling back to the captured list when config cannot be read.
Reported-by: greptile-apps[bot]
The local-turn .env reload ran for --ignore-user-config and --safe-mode sessions too, so a bypass chat read the profile file it promises not to read, and an unreadable .env could fail its turn. The reload now skips bypass sessions; the turn-runner test covers both kinds.
Reported-by: greptile-apps[bot]
An agent marked as probed without a recorded route (set before route tracking existed, or by a caller that sets the latch directly) now keeps its verdict as it did before, instead of being treated as a moved route and probed again. CI caught this on the compaction suites, whose agents set the latch by hand; 28 tests across six files failed with the probe running on a stand-in agent.
The feasibility probe ran once per agent and lowered the compression trigger to the summariser's window. Now that a cached agent can meet a new compression route mid-session, every path that latches the probe (first near-threshold request, main-model switch, first compaction) records the route it measured: provider, model, URL, context length and the URL of a `providers:` entry the task names. A later request on a different route drops the old ceiling and probes again, measuring the new summariser with the context_length configured now rather than the one captured when the agent was built. A route the check cannot read (a malformed entry) re-arms the probe instead of raising out of the main request. The probe-timing functions move to conversation_compression_feasibility.py and stay re-exported.
A messaging turn reloads .env before it runs (inside _current_max_iterations); a local session's turn took its saved turn budget instead and skipped that reload with it, so a key rotated in .env reached it only after a gateway restart. Side tasks now read config.yaml, whose ${VAR} references expand against the environment, so a local turn runs the same reload. Its turn budget stays the session's own.
A local session's compression, vision and title routes came from the copy of `auxiliary:` saved when the chat was created, while background review, /btw, /review, the curator, vision's model and every `providers:` entry the routes name were read from config.yaml. A retired side-task model therefore kept failing in every older chat, and a saved key could reach an entry's new URL. Side tasks now read the profile's config.yaml in every in-process chat, as messaging chats already do. The chat's main model and route keep the saved config, --ignore-user-config / safe-mode sessions still see no profile at all, and managed workers keep their session snapshot as a whole.
This replaces the earlier rule that a changed side-task key sends the task back to the main model; the recovery test now asserts the new key reaches the next call.
The automatic-selection case is adapted from Gille's reset-compression regression tests in #147679.
Co-authored-by: Gille <4317663+helix4u@users.noreply.github.com>
The resume refresh read config.yaml with the gateway process environment, so a ${VAR} that the profile's .env sets differently produced a changed value and a needless new generation on every attach. It now reads config.yaml the way session creation does.
The authority's roster named every profile on disk (#140417) but built those
discovered rows from a placeholder: description '', display_name set to the
handle, and neither has_avatar nor ui_meta_revisions. Desktop reads the row
for presentation — displayName() only title-cases the handle while
display_name is empty, the Edit profile dialog seeds its description field
from bot.description, and pushLocalAvatars() re-uploads a drawn image
whenever has_avatar is missing.
Send the profile's own description and display_name from its profile.yaml
(empty when it has none), and carry has_avatar and ui_meta_revisions for
every row. The two derived fields move into helpers shared with the active
profile's row so both shapes agree, and an unreadable profile.yaml still
degrades to a basic row.
(cherry picked from commit 4a0913c3fc746d5072b6abf2799ffe2a59570cfa)
(cherry picked from commit 5802ba607ab50f68cde4afe95a0a4b757fb9b0e3)
`tool_results_this_turn` stops at the most recent user row, and the loop
appends synthetic user rows inside a turn (empty-after-tool, stall,
degenerate, dropped-tool-call and stop-gate nudges). After one of them
the gate saw zero tool rows, so a finished answer that had already run
a tool got the "execute the required tool calls" nudge and an extra
call. Anchor on the turn's own user message via the helper compaction
already uses (reanchor_current_turn_user_idx), so nudge rows start no
new turn while the earlier-turn fix stays.
Patch and test by @BearHuddleston from his review of #148866.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
looks_like_codex_intermediate_ack refused to fire whenever ANY message
in `messages` was a tool result. The turn loop passes the whole session
there (gateway, CLI, resumed sessions), so once a session had run one
tool the guard was dead for every later turn: an "I'll run the tests
now." with no tool call ended the turn instead of getting the bounded
continuation nudge. Fresh sessions were unaffected, which is why it read
as "works in one-shot, broken in the gateway".
The gate's intent (ce175d73722) is "the model has not acted yet this
turn"; it now reads tool_results_this_turn(), the same window the
degenerate-final guard already uses. Tool rows inside the current turn
still end it, so the codex_only "acted, then summarised" path is
unchanged.
Salvage of #69779 by @ClaySecAI (current-turn gate scoping, commit
cb7313d9e7f). The vocabulary widening, colon-ack, after-tool relaxation
and clarification-recovery atoms are not included.
Fixes#69778
The shared gateway's profiles.list returned the launch profile's description but
hard-coded '' for every sibling profile it discovers. Desktop seeds Edit profile,
the avatar prompt, role search and Duplicate from that roster, so a saved
description on any non-default bot looked like it never saved (the file had it;
`hermes profile describe <bot>` read it back). Read it from the profile.yaml the
row already parses for display_name.
Reported on Discord (0.22.7, "bot descriptions are not saving"); diagnosed by
Gille in #149066, whose editor pre-read this replaces at the roster.
Co-authored-by: Gille <4317663+helix4u@users.noreply.github.com>
Two leaks that 6715bfd had opened relative to the previous head:
- A double- or single-quoted flag value with no closing quote within
512 characters fell back to `\S+`, so only its first word was masked
and the rest of the secret stayed visible. An unterminated or
over-long quote now masks to the end of its line. The match is
possessive, so it still never rescans the text.
- Under a qualified key (signing_key, private_key, ...), any value in
angle brackets was treated as a docs placeholder, so
`{"signing_key": "<hunter2>"}` passed through. Only word-shaped
samples (`<your key>`, `<api_key>`, `<token>`) are exempt now.
Round-4 review of d5f78d3:
- "a\"b c" and the shell 'a'\''b c' splice were cut at the first inner quote,
leaving the tail visible; a quoted value that spans a newline masked only
line 1. The quoted branch now honours escapes, may span newlines and is
capped at 512 possessive characters, so an unterminated quote falls back
to \S+ without rescanning the text.
- A value that merely starts with ***, «redacted or [REDACTED was skipped
(--password ***MyRealPass9, AccountKey=***<key>==, a file_read tail after
«redacted:ghp_…»). Only a value that IS a marker is skipped now.
- A SAS value ran to ; or whitespace and ate &foo=bar, a markdown ) and a CSV
,col2. It now ends after its sig= parameter or at ) , | and backtick.
- Qualified key names (encryptKey, master_key, private_key) no longer mask
the non-secret samples true/false/yes/no/null/none/default and <placeholder>.
Greptile round on 6eb25fd:
- PEM bodies become visible: private-key block passes now run before the
flag/connection-string passes, so AccountKey=-----BEGIN ... is masked whole.
- File masks resemble usable credentials: flag/connstr values take the
file_read non-reusable sentinel and existing markers are not re-masked.
- Quoted password tails remain visible: single and double quoted flag and
container-login values are matched separately.
- Azure signatures remain visible: a SharedAccessSignature value runs to the
next ';' instead of stopping at '&'.
- PuTTY file reads reveal keys: .ppk body lines accept read_file's gutter.
- Short signing secrets remain visible: the JSON/ENV assignment gate uses
the qualified-key policy is_secret_field_name already applies.
- The PEM pass gate requires -----END, which the pattern needs anyway; it
drops a 1 s scan on repeated BEGIN headers.