Skip to content

chore: promote staging to staging-promote/6daa2f15-23538193544 (2026-03-25 18:47 UTC)#1645

Merged
henrypark133 merged 8 commits intostaging-promote/6daa2f15-23538193544from
staging-promote/0341fcc9-23558273569
Mar 25, 2026
Merged

chore: promote staging to staging-promote/6daa2f15-23538193544 (2026-03-25 18:47 UTC)#1645
henrypark133 merged 8 commits intostaging-promote/6daa2f15-23538193544from
staging-promote/0341fcc9-23558273569

Conversation

@ironclaw-ci
Copy link
Copy Markdown
Contributor

@ironclaw-ci ironclaw-ci bot commented Mar 25, 2026

Auto-promotion from staging CI

Batch range: 0d1a5c210b877f89bcb87e6f1d8584396d12f208..0341fcc9405e3a9f22319891dc1d55d3a67edc06
Promotion branch: staging-promote/0341fcc9-23558273569
Base: staging-promote/6daa2f15-23538193544
Triggered by: Staging CI batch at 2026-03-25 18:47 UTC

Commits in this batch (44):

Current commits in this promotion (2)

Current base: staging-promote/6daa2f15-23538193544
Current head: staging-promote/0341fcc9-23558273569
Current range: origin/staging-promote/6daa2f15-23538193544..origin/staging-promote/0341fcc9-23558273569

Auto-updated by staging promotion metadata workflow

Waiting for gates:

  • Tests: pending
  • E2E: pending
  • Claude Code review: pending (will post comments on this PR)

Auto-created by staging-ci workflow

ilblackdragon and others added 2 commits March 25, 2026 08:35
… all surfaces (#1513)

* feat(agent): thread per-tool reasoning from LLM through to REPL, HTTP, SSE, and DB

Add end-to-end agent reasoning summaries so users can see *why* the
agent chose specific tools, not just what it did.

- Add `reasoning: Option<String>` to `ToolCall` (all providers)
- Populate from LLM response content in `Reasoning::respond_with_tools`
  and `select_tools`, with per-tool override when providers supply it
- Extend `Turn` with `narrative` and `TurnToolCall` with `rationale` +
  `tool_call_id` for identity-based result matching
- Persist reasoning in DB via existing tool_calls JSON (no migration)
- Add `StatusUpdate::ReasoningUpdate` and `SseEvent::ReasoningUpdate` +
  `SseEvent::JobReasoning` for real-time streaming
- Emit reasoning events in both chat dispatcher and worker job path
- Add `/reasoning [N|all]` command for inspecting turn reasoning
- Surface `narrative` and `rationale` in HTTP `/api/chat/history`

Based on the design from #361 and #456, reconstructed cleanly with
Option<String> to minimize blast radius (vs mandatory String that broke
compilation in #456).

Closes #456

Co-Authored-By: panosAthDBX <47406510+panosAthDBX@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address PR review feedback from Gemini and Copilot

- Fix `_ => Ok(None)` in agent_loop.rs to avoid accidental shutdown
- Fix fallback in record_tool_result_for/record_tool_error_for to use
  first pending call instead of last_mut (parallel execution safety)
- Include per-tool decisions in WASM channel reasoning messages
- Apply truncate_at_tool_tags + clean_response to shared_reasoning in
  select_tools (parity with respond_with_tools)
- Persist turn-level narrative to DB in tool_calls JSON wrapper
- Parse both old (array) and new (object) tool_calls formats in
  build_turns_from_db_messages for backward compatibility
- Populate reasoning from action.reasoning in execute_plan ToolCalls

[skip-regression-check]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address second round of review comments + merge fixes

- Add reasoning: None to new github_copilot.rs ToolCall sites (from staging merge)
- Run cargo fmt on 4 files with formatting diffs
- Truncate narrative to 1000 chars before DB persistence
- Clone turn data and drop session lock in /reasoning command
- Extract ToolDecisionDto::from_json_array shared helper (deduplicate
  worker/job.rs and orchestrator/api.rs)
- Add unit tests for wrapped tool_calls JSON format with narrative

[skip-regression-check]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address third round of review comments (Copilot + serrrfirat)

- Reword ToolCall.reasoning docstring to reflect provider-supplied or
  fallback contract
- Sanitize narrative through SafetyLayer before storage/emission
- Clean per-tool reasoning via truncate_at_tool_tags + clean_response
  in select_tools (parity with shared reasoning)
- Convert 4 approval-path recording sites in thread_ops.rs to
  identity-based record_tool_result_for/record_tool_error_for
- Preserve tool_call_id and reasoning through restore_from_messages
- Fix has_result/has_error to reject JSON null values
- Truncate tool_call_id to 128 chars before DB persistence
- Add 4 unit tests for record_tool_result_for/error_for edge cases

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address zmanian review — sanitize JobDelegate reasoning + warn on dropped results

- Sanitize narrative and per-tool rationale through SafetyLayer in
  JobDelegate reasoning events (parity with ChatDelegate)
- Add tracing::warn when record_tool_result_for/error_for drops a
  result because no matching or pending tool call exists
- Add 3 unit tests for reasoning normalization (thinking tags,
  tool tags, empty-after-cleaning)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address 4 remaining unreplied review comments

- Clean per-tool reasoning in respond_with_tools via truncate_at_tool_tags
  + clean_response (parity with select_tools)
- Handle wrapped JSON format in rebuild_chat_messages_from_db so cold
  hydration works after persist_tool_calls format change
- Update persist_tool_calls doc comment to describe new JSON shape
- Sanitize per-tool rationale through SafetyLayer in ChatDelegate before
  emission and storage (parity with JobDelegate)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address zmanian review round 2

- Add tracing::debug on fallback-to-pending path in record_tool_result_for
  and record_tool_error_for (item 1)
- Add comment explaining why /reasoning is special-cased in agent_loop.rs
  (item 4)
- Items 2 (narrative persistence), 3 (rationale sanitization), and 5
  (catch-all fix) were already addressed in prior commits

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: panosAthDBX <47406510+panosAthDBX@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix REPL single-message hang and cap CI test duration

* Fix Clippy nested-if lint in REPL startup

* Fix single-message approval flow

* Handle empty single-message REPL exits

* Wait for one-shot event routines before exit
@github-actions github-actions bot added scope: agent Agent core (agent loop, router, scheduler) scope: channel Channel infrastructure scope: channel/web Web gateway channel scope: channel/wasm WASM channel runtime scope: llm LLM integration scope: orchestrator Container orchestrator scope: worker Container worker scope: ci CI/CD workflows size: XL 500+ changed lines risk: medium Business logic, config, or moderate-risk modules contributor: core 20+ merged PRs labels Mar 25, 2026
@claude
Copy link
Copy Markdown

claude bot commented Mar 25, 2026

Code review

Found 5 issues:

  1. [MEDIUM:75] Two nearly-identical struct types for tool decisions — ToolDecisionDto (in ironclaw_common) and ToolDecision (in src/channels/channel.rs) violate DRY principle. Conversion happens at SSE serialization boundaries. Should consolidate to single source of truth.

    https://github.com/anthropics/claude-code/blob/37679d2/src/channels/web/util.rs#L35-L50

  2. [MEDIUM:75] Hot path cloning in dispatcher.rs — decisions Vec is cloned twice during tool call processing (construction and emission). For agents with many tool calls, this compounds on every request.

    https://github.com/anthropics/claude-code/blob/37679d2/src/agent/dispatcher.rs#L501-L502

  3. [LOW:70] Sanitization overhead in decision loop at dispatcher.rs — per-tool rationale sanitized via sanitize_tool_output() for each tool call. If safety layer performs heavy validation, this creates potential bottleneck with unbounded iteration.

    https://github.com/anthropics/claude-code/blob/37679d2/src/agent/dispatcher.rs#L475-L489

  4. [LOW:65] Silent-failure parsing in ToolDecisionDto::from_json_array() — malformed JSON objects are silently skipped via filter_map without logging. Add trace-level logging for debugging deserialization issues from containers/workers.

    https://github.com/anthropics/claude-code/blob/37679d2/crates/ironclaw_common/src/event.rs#L19-L27

  5. [LOW:60] Command routing anomaly — /reasoning command handled specially in agent_loop.rs outside normal handle_system_command dispatch pattern. Breaks routing abstraction documented in CLAUDE.md. Should be unified in router design or documented as intentional exception.

    https://github.com/anthropics/claude-code/blob/37679d2/src/agent/agent_loop.rs#L90-L100

* Fix REPL single-message hang and cap CI test duration

* Fix Clippy nested-if lint in REPL startup

* Fix single-message approval flow

* Handle empty single-message REPL exits

* Wait for one-shot event routines before exit

* Fix MCP lifecycle trace user scope
* Fix REPL single-message hang and cap CI test duration

* Fix Clippy nested-if lint in REPL startup

* Fix single-message approval flow

* Handle empty single-message REPL exits

* Wait for one-shot event routines before exit

* Fix MCP lifecycle trace user scope

* Normalize cron schedules on routine create
…3131

chore: promote staging to staging-promote/ab0ad948-23563320113 (2026-03-25 21:37 UTC)
…0113

chore: promote staging to staging-promote/c949521d-23562109203 (2026-03-25 20:47 UTC)
…9203

chore: promote staging to staging-promote/0341fcc9-23558273569 (2026-03-25 20:19 UTC)
@henrypark133 henrypark133 merged commit c98ec3f into staging-promote/6daa2f15-23538193544 Mar 25, 2026
12 of 13 checks passed
@henrypark133 henrypark133 deleted the staging-promote/0341fcc9-23558273569 branch March 25, 2026 22:13
@github-actions github-actions bot added scope: tool/builtin Built-in tools scope: workspace Persistent memory / workspace labels Mar 25, 2026
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
…3558273569

chore: promote staging to staging-promote/6daa2f15-23538193544 (2026-03-25 18:47 UTC)
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
…3558273569

chore: promote staging to staging-promote/41241ef5-23538193544 (2026-03-25 18:47 UTC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: agent Agent core (agent loop, router, scheduler) scope: channel/wasm WASM channel runtime scope: channel/web Web gateway channel scope: channel Channel infrastructure scope: ci CI/CD workflows scope: llm LLM integration scope: orchestrator Container orchestrator scope: tool/builtin Built-in tools scope: worker Container worker scope: workspace Persistent memory / workspace size: XL 500+ changed lines staging-promotion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants