Skip to content

feat(sidecar,shell): 24-step turns, failure output reaches the model (v0.5.1 HGW-W5/W6) - #82

Closed
SaulBuilds wants to merge 2 commits into
hgw/w1-project-createfrom
hgw/w1-loop-capability
Closed

SaulBuilds wants to merge 2 commits into
hgw/w1-project-createfrom
hgw/w1-loop-capability

Conversation

@SaulBuilds

@SaulBuilds SaulBuilds commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

HGW Week 1, runtime, 4 of 5. Stack: #79 → #80 → #81 → this PR (base hgw/w1-project-create) → #83. Green on its own. Refs #76 (HGW-W6) and CitrateNetwork/citrate-core#291 (HGW-W5, runtime default).

What changes

  • Turns: the default maxSteps goes from 8 to 24 (sessions::DEFAULT_MAX_STEPS); the cap stays 32. A session's own maxSteps still wins. The sidecar-wide default is CITRATE_HERMES_MAX_STEPS (clamped 1–32).
  • Capture (agent-shell): a capped stream now keeps its first half and its last half (the first error and the final cause), with the truncation marker between them. Before, it kept only the head.
  • shell_run on failure: a non-zero exit puts the exit status and the end of stderr in the summary the model reads first. If stderr is empty, it uses the end of stdout. The tail is at most FAILURE_TAIL_BYTES = 2048 bytes. The run facts carry stderr_tail / stdout_tail. Successful runs are unchanged.
  • Toolchain with no report (for example forge exiting before tests):
    • the summary now states the exit code;
    • recognized compiler errors stay sanitized and trusted, as before: injected source text never reaches trusted output;
    • when no cause is recognized (a missing solc or library, a crash), the end of stderr is handed over raw and bounded, and the result is Untrusted. It taints the session; with feat(sidecar): taint escalates to HIC approval (v0.5.1 HGW-W1) #79, later actions then go to cards.

Interface for the core lane

  • core#291: build sessions can stop sending maxSteps, or send 24; 32 is the most.
  • shell_run results carry run.stderr_tail / run.stdout_tail on failure. The Activity card can show them.

Not done from #76

Trimming the model's copy of shell_run output to 4 KB while the event log keeps the full text. Model content and event content are one string today, so this needs a loop change. The summary tail gives the model the cause either way.

Tests (red first)

  • agent-shell runner: +1 (head and tail kept); two capture assertions extended.
  • loop_capability_tests: +3 (24-step default, per-session and per-sidecar settings, environment parsing).
  • shell_run failure tail: +1.
  • Toolchain unparsed stderr: +1 (Untrusted with the raw tail; recognized diagnostics stay trusted).
  • Workspace: 2282 → 2288 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_018wWZZ8GRVU9USh3kKQHsFe

…t on (HGW-4)

A build needs more than 8 model calls, and a failing step has to show
the model why it failed.

- Turns: default maxSteps 8 -> 24 (sessions::DEFAULT_MAX_STEPS), cap
  stays 32. A session's maxSteps still wins; the sidecar-wide default
  is configurable with CITRATE_HERMES_MAX_STEPS (clamped 1..=32).
- Capture (agent-shell): a capped stream now keeps its first half-cap
  and its last half-cap (first error and final cause), with the
  truncation marker between them, instead of only the head.
- shell_run: a non-zero exit puts the exit status and the end of stderr
  (or stdout when stderr is empty), at most FAILURE_TAIL_BYTES = 2048,
  in the summary the model reads first, and as stderr_tail/stdout_tail
  in the run facts. Successful runs are unchanged.
- Toolchain: a run with no parseable report now states the exit code.
  Recognized compiler errors stay sanitized and trusted (the S6.3
  guarantee: injected text in sources never reaches trusted output).
  When no cause is recognized, the end of stderr is handed over raw,
  bounded, and the result is Untrusted, so it taints the session (and,
  with HGW-1, later actions go to HIC cards).

Tests: agent-shell runner (+1, two capture assertions extended),
loop_capability_tests (+3), shell_run failure tail (+1), toolchain
unparsed stderr (+1). Workspace: 2279 -> 2285 passed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018wWZZ8GRVU9USh3kKQHsFe

@BerryManifold BerryManifold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed step-limit defaults/clamping, bounded head/tail output capture, UTF-8 boundaries, and failure-output trust handling. Independently ran all 3 loop-capability tests and 3 capped-output runner tests on the #84 stack head: passed. No new blocking finding in this incremental diff. Approval does not clear the separate git-state blocker affecting the stack or replace required CI checks.

@Matr0xshka Matr0xshka left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed step-limit defaults/clamping, bounded head/tail output capture, UTF-8 boundaries, and failure-output trust handling. Independently ran all 3 loop-capability tests and 3 capped-output runner tests on the #84 stack head: passed. No new blocking finding in this incremental diff. Approval does not clear the separate git-state blocker affecting the stack or replace required CI checks.

…dependency updates, #85)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018wWZZ8GRVU9USh3kKQHsFe
@SaulBuilds

Copy link
Copy Markdown
Contributor Author

Landed in main via #84 (squash 75e21cd), per the owner's 2026-10-15 decision to land the HGW stack #80–#84 as one squash. Reviewed and approved here.

@SaulBuilds SaulBuilds closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants