Skip to content

Canary: prove which served text each host reads before its next action #5

Closed

Description

@lukemaj

What: A canary per host and seam shows which served text each agent host reads before its next action inside Chromeria.
Why: Hook context can arrive after the action it was meant to precede, so no serving outcome can be trusted until delivery is observed per host and seam.
So what: An agent runs the canaries and records the seam table; serving work builds on the seams it proves.

Parent

#3

Outcome

A table, for Claude Code, Codex, Grok Build and OpenCode running under Chromeria, of each seam (user message, tool result, tool failure, pre-tool deny, before-done) with the observed result: whether the model quotes a served canary string before its next action, the delivery latency, and any size limit or spill behavior seen.

Elon record

  • Requirements and who asked: proof of delivery before trusting any ignored label (all three gap reviewers); serving before "done" restored (user); Codex post-tool context to be settled by a canary instead of open research (gap review synthesis).
  • Deleted: further desk research on Codex delivery (source and CLI probes already exist); a Chromeria approval-path change.
  • Bottleneck: every later serving outcome depends on knowing which seams deliver before the next decision.
  • Checked myself: the before-action delivery research (CLI probes in all four harnesses: deny then retry works; added context arrives after the action; hooks already fire in Chromeria-launched Codex, Claude Code and Grok sessions).

Acceptance criteria

  • Every host and seam pair has an observed result (delivered before next action, delivered after, discarded, or no seam), each from a canary run inside Chromeria.
  • The before-done seam is probed on every host that has one.
  • Hook configuration changes on each machine are recorded in the user's runbook and reverted or kept as stated.

Non-goals

  • Building the serving server or any lane.
  • Probing models beyond one ordinary model per host.

Blocked by

  • None

Required proof

  • The seam table with the run evidence for each cell, posted on this Issue.

Activity

  1. lukemaj commented on Oct 12, 2026

    @lukemaj
    ContributorAuthor

    What: All four hosts were canaried inside Chromeria; the seam table and the canary are in PR #21.
    Why: Serving (#3) needs observed delivery per host and seam before it builds on any seam.
    So what: The user reviews and merges #21. #3 should replace "Grok Build post-tool events only" with Grok PreToolUse additionalContext (see below).

    Run evidence per cell

    Each cell: the token the hook served, then what happened. "Quoted before" means the model's message quoting that token came before its next tool call or end of turn. Each run was read in the Chromeria timeline, the hook log, and the host's own session record (Claude Code transcript, Codex rollout, Grok chat_history.jsonl, OpenCode database). Chromeria 0.0.45, 2026-10-12.

    Claude Code 2.1.292, claude-haiku-4-5

    • User message: UserPromptSubmit context CMDCANARY-PROMPT-E362, quoted before the first command.
    • Tool result: PostToolUse context CMDCANARY-RESULT-8DC7, quoted before the next command.
    • Tool failure: ls exit 1 fired PostToolUseFailure; CMDCANARY-FAILURE-2DFE quoted before the next command.
    • Pre-tool deny: CMDCANARY-DENY-7E62 in the tool error PreToolUse:Bash hook error: ..., quoted, then the retry passed.
    • Before done: Stop block CMDCANARY-DONE-D9FC, quoted in the continuation; the second stop passed.
    • Size: 11.7 KB context became <persisted-output> "Output too large (11.7KB)" with a 2 KB preview and a file path. BIGHEAD quoted, BIGTAIL not seen.

    Codex 0.160.1, gpt-6-astra low (temporary CODEX_HOME)

    • User message: CMDCANARY-PROMPT-1CF5, recorded as a developer message right after the user message; quoted first.
    • Tool result: CMDCANARY-RESULT-4EA6, developer message after the output; quoted before the next command.
    • Tool failure: no PostToolUseFailure event in Codex; ls exit 1 fired PostToolUse, CMDCANARY-RESULT-9DD4 quoted before the next command.
    • Pre-tool deny: CMDCANARY-DENY-7B16 quoted, then the retry passed.
    • Before done: Stop block became a hook prompt; CMDCANARY-DONE-BDB6 quoted.
    • Size: 2,988 tokens of context were cut in the middle (Warning: truncated output (original token count: 2988)); BIGHEAD and BIGTAIL both quoted.

    Grok Build 1.0.13, grok-build (three Chromeria runs)

    • Run 1, plain folder: no project hook fired at all. Grok loads project hooks only inside a git repository with folder trust.
    • Run 2, git folder, GROK_FOLDER_TRUST=0. Grok sends snake_case event names (pre_tool_use); the hook was fixed for that.
      • User message: CMDCANARY-PROMPT-9DB5 was served but is absent from the session history; the model wrote "no canary". Discarded.
      • Tool result: PostToolUse context CMDCANARY-RESULT-64BF, -6394, -3FB8 all absent from history; "no canary" each time. Discarded. A direct grok -p run showed the same.
      • Tool failure: ls exit 1 fired PostToolUse, not PostToolUseFailure.
      • Pre-tool deny: CMDCANARY-DENY-42F9 quoted, then the retry passed.
      • Before done: CMDCANARY-DONE-9D51 quoted.
    • Run 3, adding PreToolUse additionalContext on every canary command:
      • Tool result: CMDCANARY-PRECTX-948D arrived with the result and was quoted before the next command.
      • Tool failure: CMDCANARY-PRECTX-BCB8 arrived with the failed ls result and was quoted before the next command.
      • Deny CMDCANARY-DENY-8428 and before-done CMDCANARY-DONE-1687 quoted again.
      • Size: context clipped at 10,000 characters; BIGHEAD quoted, BIGTAIL absent from history.

    OpenCode 1.18.31, opencode/big-pickle

    • User message: text part added in experimental.chat.messages.transform, CMDCANARY-PROMPT-04D9, quoted first.
    • Tool result: appended to the output in tool.execute.after, CMDCANARY-RESULT-1D84, quoted before the next command. The text is visible in the Chromeria tool output.
    • Tool failure: ls exit 1 still ran tool.execute.after (metadata.exit 1); CMDCANARY-FAILURE-EED6 quoted.
    • Pre-tool deny: error thrown in tool.execute.before, CMDCANARY-DENY-33E3 quoted, then the retry passed.
    • Before done: no seam. The plugin API in 1.18.31 has no stop hook.
    • Size: all 11,951 appended characters arrived; BIGHEAD and BIGTAIL both quoted.
    • The model wrote tokens as CMD CANARY-... with a space; counted as quoted.

    Hook overhead: about 20 ms per fire (median of 20). Hook-exit-to-quote times per cell are in canary/README.md.

    Machine changes

    Two temporary Chromeria provider instances (codexCanary with a temporary Codex home, grokCanary with GROK_FOLDER_TRUST=0) were added for the runs and removed afterwards. The copied Codex credential was deleted. Real Codex, Claude Code, Grok and OpenCode configs and Grok's trusted-folder list were not changed. Recorded in the user's runbook.

    Limits

    One run per host and seam with one model per host; shell commands only; Claude Code and Codex ran the hook before the Grok-only fixes, which do not change their behavior.

  2. lukemaj commented on Oct 12, 2026

    @lukemaj
    ContributorAuthor

    What: The seam table with per-cell delivery times, completing the run evidence in the comment above.
    Why: Review of #21 found the times and the table were only in canary/README.md, not on this Issue.
    So what: No action needed beyond reviewing #21.

    Each cell: the served token, the result, and the time from the hook's exit (hook log t_end) to the model message quoting it (Chromeria timeline for Claude Code and Grok, Codex rollout, OpenCode database part times). The time is mostly model latency; the hook itself takes about 20 ms of wall time, Python startup included (median of 20 /usr/bin/time runs).

    Host User message Tool result Tool failure Pre-tool deny Before done
    Claude Code PROMPT-E362 delivered before, 3.5 s RESULT-8DC7 delivered before, 1.3 s FAILURE-2DFE delivered before, 1.5 s DENY-7E62 delivered before, 1.9 s DONE-D9FC delivered before, 1.4 s
    Codex PROMPT-1CF5 delivered before, 2.5 s RESULT-4EA6 delivered before, 2.7 s via PostToolUse: RESULT-9DD4 delivered before, 3.0 s DENY-7B16 delivered before, 2.5 s DONE-BDB6 delivered before, 2.5 s
    Grok Build PROMPT-9DB5, PROMPT-43BB discarded PostToolUse RESULT-64BF, -6394, -3FB8 discarded; PreToolUse PRECTX-948D delivered before, 3.0 s PreToolUse PRECTX-BCB8 delivered before, 4.8 s DENY-42F9 delivered before, 2.2 s (run 3: DENY-8428, 2.2 s) DONE-9D51 delivered before (run 3: DONE-1687, 4.2 s)
    OpenCode PROMPT-04D9 delivered before, 5.4 s RESULT-1D84 delivered before, 2.7 s FAILURE-EED6 delivered before, 2.4 s DENY-33E3 delivered before, 2.8 s no seam

    Size, at the tool-result seam with about 12,000 characters: Claude Code BIGHEAD-583C quoted, BIGTAIL-FC86 spilled to a file (2 KB preview); Codex BIGHEAD-AB79 and BIGTAIL-9D25 both quoted after a middle cut of a 2,988-token context; Grok BIGHEAD-5969 quoted, BIGTAIL-491C clipped at 10,000 characters; OpenCode BIGHEAD-D0AE and BIGTAIL-5B2E both quoted.

    Correction to the Grok run 1 note above: that run's Grok process had GROK_FOLDER_TRUST=0 in its environment (read from the running process), so folder trust was off; the plain folder (no git repository) is what kept project hooks from loading. A direct grok -p run with the same variable showed the same: no hook in a plain folder, hooks firing after git init. /hooks-trust was not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions