Skip to content

Opt examples - #95

Merged
bouillipx merged 2 commits into
mainfrom
opt_hook_example
Feb 25, 2026
Merged

bouillipx merged 2 commits into
mainfrom
opt_hook_example

Conversation

@bouillipx

Copy link
Copy Markdown
Collaborator
image ## Summary - What does this PR change? - Why is this change needed?

Scope (One PR One Thing)

  • Primary objective:
  • Out of scope:
  • I confirm this PR handles a single objective only: [ ] Yes

Changed Files (required)

List all touched files and why each file changed.

File Reason
path/to/file reason

If this PR is a large diff (>300 changed lines), explain why split PRs are not possible and provide a split follow-up plan.

Acceptance Criteria

  • Criteria 1
  • Criteria 2

Test Evidence (required)

  • Local commands run:
    • ...
  • CI links or job names:
    • ...
  • Evidence/output summary:
    • ...

If this PR changes high-risk runtime paths (auth/concurrency/execution control), include risk-matrix evidence.

Risk and Rollback

  • Risk level: Low / Medium / High
  • Main risk points:
  • Rollback plan:

Dependency and Lockfile Changes

  • Lockfile changed in this PR: [ ] Yes [ ] No
  • If yes, manifest updated in same PR (requirements.txt/pyproject.toml/package.json): [ ] Yes [ ] No [ ] N/A

Agent Rules Checklist (required)

Reference: docs/agent_rules.md

  • Only task-related files changed; no opportunistic refactor
  • Public interfaces/data structures unchanged unless explicitly required
  • Tests added/updated and evidence attached
  • Any skip/only/exclude usage is explained and reviewed
  • Merge will be done by approved reviewer (no self-merge auto-ship)

…trols

Introduce end-to-end LLM I/O observability and CLI ergonomics for multi-turn sessions.

Observability:
- Add LLMIOCaptureHook to persist raw request/response/usage records as JSONL for every model call.
- Prefer conversation_id as trace file key (<conversation_id>.llm_io.jsonl) and fall back to run_id when absent.
- Keep original LLM payload fidelity in records (request.messages/tools/metadata + response.content/tool_calls/metadata).
- Add summarize_llm_io_trace utility and a standalone scripts/llm_io_summary.py helper.
- Extend summary script to aggregate all trace files, show per-call previews, and optionally print user history with --show-history.

Runtime propagation:
- Enrich DareAgent hook/event payloads with conversation_id when provided in Task metadata.
- Preserve compatibility by leaving existing run_id/task_id/session_id behavior intact.
- Ensure AFTER_MODEL hook payload contains model_output used by capture hook.

Builder and docs:
- Auto-inject llm_io_capture hook from DareAgentBuilder when capture_content or DARE_LLM_IO_CAPTURE is enabled.
- Document new local capture behavior and keying rules in observability usage docs.

Example 04 CLI improvements:
- Add visible approval wait events and interactive approval resolution (once/workspace/deny).
- Add /approvals command family (list/poll/grant/deny/revoke).
- Add --workspace support (default current cwd) and --conversation-id for stable session tracing.
- Thread a single conversation_id through the whole CLI session and inject it into Task metadata.

Tests:
- Add focused unit coverage for capture hook, summary script, 04 CLI behavior, and hook payload propagation.
- Update existing builder/hook governance tests to cover new observability paths.

Verification:
- .venv/bin/pytest tests/unit/test_builder_hook_ordering.py tests/unit/test_dare_agent_hook_governance.py tests/unit/test_llm_io_capture_hook.py tests/unit/test_llm_io_summary_script.py tests/unit/test_examples_04_cli.py tests/unit/test_examples_cli.py tests/unit/test_examples_cli_mcp.py
@bouillipx
bouillipx merged commit ed57064 into main Feb 25, 2026
6 checks passed
@bouillipx
bouillipx deleted the opt_hook_example branch February 25, 2026 01:55
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.

1 participant