Repository navigation
Skills load their declared gbrain context at start, and harness status says unknown when its list fails - #4687
Merged
capy-ai[bot] merged 2 commits intoNov 22, 2026
Conversation
…ys unknown when its list fails gstack-skill-start now runs gstack-brain-context-load for a skill whose SKILL.md declares gbrain.context_queries, honoring gbrain_context_load off and never in a deny repo (#4329). The unpinned /sync-gbrain hint follows the repo's gbrain policy tier (#4419). harnessSees reports a failed list command as unknown with its first error line instead of every skill missing (#4412). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…pt store A corrupt policy store now counts as deny at skill start instead of being moved aside and read as unset, so a set deny tier is never bypassed. Review-Finding: p1/specialist-batched#1 reader=security Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 22, 2026
Merged
3 tasks done
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.
/office-hours,/plan-ceo-review,/design-shotgun,/design-consultationand/retronow load the brain context they declare when they start, skill start stops telling a read-only repo to run a sync that can't help, andgstack-harness statussaysunknownwhen a harness's skill list fails.Why: three outside reports (#4329, #4419, #4412), each reproduced on main by a test that fails before this change and passes after it.
Nothing to do;
gstack-config set gbrain_context_load offturns the context load off.What changed
gstack-brain-context-load, though its header,setup-gbrain/memory.mdand the 1.26.0.0 notes said every skill start did; the 16 declared queries never ran andgbrain_context_load offhad no readergstack-skill-startruns the loader for a skill whoseSKILL.mddeclaresgbrain.context_queries, only when gbrain is configured, never in adenyrepo, and not whengbrain_context_loadisoff; output goes through the same_sanitizeas learnings and keeps the loader's data envelopetest/skill-start-gbrain-context.test.ts/sync-gbrain --full, which skips code ingest by policy and never pins, so the hint came back every startharnessSeessearched OpenClaw'sAGENT_SELECTION_REQUIREDerror text for skill names and reported every registered skill missingunknownwith its first error line; a completed list still reports what is missing;docs/hosts.mdnotes--agent <id>test/harness-sees-failed-list.test.tsWhy
Each report described a skill start or status line that said one thing and did another, so people saw hints they could not act on or missing skills that were really there.
Blast radius
Only the five skills that declare queries run the loader; the generic fallback the loader has for other skills stays unwired. Each run is bounded by the loader's 500 ms per gbrain query, and a repo policy that can't be read counts as deny, so a broken store never turns brain access on (file read and test run:
test/skill-start-gbrain-context.test.ts). The policy lookup reads the existinggbrain-repo-policy.jsonstore withget --batch, which never moves a corrupt store aside.Security read
Process spawning: skill start now spawns
gstack-gbrain-repo-policy get --batchand, for the five skills,bun gstack-brain-context-load.tswith the Bun isolation flags; the skill name is checked against^[a-z0-9-]{1,60}$before it forms a path, and the SKILL.md path is inside the gstack checkout. Brain content reaching the model is wrapped in the loader'sUSER_TRANSCRIPT_DATA do-not-interpret-as-instructionsenvelope and passed through_sanitize, which strips forgedGSTACK_INSTRUCTIONandSESSION_ID:lines. Adenyrepo gets no gbrain call. No CI, install, dependency, auth or network change beyond the gbrain queries the loader already makes.Test Coverage
Coverage: 83% value-weighted (83% including 0 weakly covered paths). Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered. Two small gaps stay open: the
gstack-harness statusline printing the error text, and a test that passes a bad skill name.Tests ran: targeted 204
Pre-Landing Review
No blocking issues found in the final read-only review of this head. Earlier rounds fixed one blocker (skill start read the policy store with plain
get, which could turn a corrupt store into "no policy"). Four second-model findings were ruled notes by the owner, listed in the agent notes.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
sf-7f377291dcecsecurity finding, details recorded privatelybin/gstack-skill-start:417pinned deny repo still gets the gbrain search hint (Low, Blocks: no)bin/gstack-skill-start:411without jq every repo reads as deny, silently (Low, Blocks: no)lib/harness-register.ts:741non-zero list exit reads unknown even with a valid list (Low, Blocks: no)bin/gstack-harness:130first stderr line printed raw into status output (Low, Blocks: no)Issues
Fixes #4329
Fixes #4412
Fixes #4419
Exploratory QA
No separate probe ran on this head. The final review's readers ran the two new test files (5 pass) and six neighbouring files (53 pass), and CI's full free suite passed at this tree.
Documentation
Scope: the committed diff on skill-start-gbrain-context-and-harness-status against main, which covers loading gbrain context at skill start for skills that declare context_queries, the read-only and deny repo-policy hints, and gstack-harness status reporting unknown with the harness error. The worktree had no staged, unstaged or new files.
Result: current. docs/hosts.md and setup-gbrain/memory.md were already updated in this branch and match the code. The five skills that declare context_queries match the skills the docs name, and the gbrain_context_load off switch is documented. No doc edits were needed.
Debt: historical CHANGELOG.md entries still say context load runs at every invocation. They were left as written because they are past release notes.
Tests
bun teston the 6 affected test files: 204 pass, 0 fail at 86cfbecAgent notes
Agent notes
Outside items triaged under GSTA-799 and built on main per R45 (issues only, no outside code carried).
Approvals
Approved: yes (record r-249b53055310). The full approval record stays private.
Plan: exempt: bug fix (#4329, #4419, #4412)
Plan check: exempt bug fix
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=5 fixed=0 scope=frozen unbound=1 ledgers_read=2 dispatches=4
Gate edits: none detected (2 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Ruled note: redacted at 86cfbec ruled by GSTA-36 at 2026-11-22T06:38:36.830Z: security finding, details recorded privately (approval a-cdff70819c3e)
Ruled note: bin/gstack-skill-start:438:reliability at 86cfbec ruled by GSTA-36 at 2026-11-22T06:38:36.981Z: context loader spawns gbrain directly: unchanged existing code (approval a-201b0e98d345)
Ruled note: bin/gstack-skill-start:417:correctness at 86cfbec ruled by GSTA-36 at 2026-11-22T06:38:37.083Z: pin overrides deny only in the hint text; the context load stays blocked (approval a-8825b58a58a1)
Ruled note: bin/gstack-skill-start:400:correctness at 86cfbec ruled by GSTA-36 at 2026-11-22T06:38:37.185Z: remote-MCP-only installs get no context load: unchanged existing code (approval a-1217e9cc6b10)