Commit Graph

527 Commits

Author SHA1 Message Date
ClaudeBot 1cf06bfa69 fix(template): change Mini App port to 18081
Build Claw Telegram / build (push) Successful in 5m3s
Build Claw Telegram / cleanup (push) Successful in 1s
Entire 808x range is occupied on the Unraid host.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:55:56 +02:00
Wylabb bab7fb7d01 Add artifact routing diagnostics
Build Claw Telegram / cleanup (push) Has been cancelled
Build Claw Telegram / build (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:50:39 +02:00
ClaudeBot 93f74e37c0 fix(template): change Mini App port from 8081 to 8087
Build Claw Telegram / build (push) Successful in 5m0s
Build Claw Telegram / cleanup (push) Successful in 1s
8081 is already in use on the Unraid host.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:40:43 +02:00
Wylabb ce74ec34cb Add Mini App config to Unraid gateway template
Build Claw Telegram / build (push) Successful in 5m4s
Build Claw Telegram / cleanup (push) Successful in 2s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:10:16 +02:00
Wylabb c04d952b1b Add Mini App artifact delivery for previewable files
Build Claw Telegram / build (push) Successful in 5m44s
Build Claw Telegram / cleanup (push) Successful in 1s
Previewable files (HTML, MD, code, JSON, etc.) now open in
the Telegram Mini App instead of being uploaded as raw files.
Images and binaries still use Telegram upload.

- Add is_previewable() classifier for ~40 text/code extensions
- Add artifact registry with TTL-based expiry
- Add /miniapp/api/artifacts/:turn_id/:file_id proxy endpoint
- Add /miniapp/view/:turn_id/:file_id viewer with auto-auth
- Route previewable artifacts to "View in Mini App" web_app button
- Extract fetch_generated_file() for raw byte + content-type access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 11:50:52 +02:00
Wylabb e7eaf9ed93 Port teamwork parity slice and add miniapp foundation 2026-04-05 11:50:52 +02:00
Wylabb d164dc5f8e Add session-scoped Telegram approvals
Build Claw Telegram / build (push) Successful in 4m38s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 07:40:39 +02:00
Wylabb 04b482fbc8 Persist Unraid gateway template values
Build Claw Telegram / build (push) Successful in 4m34s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 07:22:01 +02:00
Wylabb 51b47c93d2 Render Telegram output as HTML
Build Claw Telegram / build (push) Successful in 4m27s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 07:11:56 +02:00
Wylabb 83e313ec6d Add Anthropic prompt-cache request shaping
Build Claw Telegram / build (push) Successful in 4m38s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 06:59:01 +02:00
Wylabb 721f05892f Log Anthropic rate limit context
Build Claw Telegram / build (push) Successful in 4m8s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 05:39:56 +02:00
Wylabb 6546a0fef9 Improve Anthropic rate limit reporting
Build Claw Telegram / build (push) Successful in 4m16s
Build Claw Telegram / cleanup (push) Successful in 2s
2026-04-05 05:29:47 +02:00
Wylabb a46eb730c2 Keep Anthropic beta flags out of JSON body
Build Claw Telegram / build (push) Successful in 4m41s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 02:56:03 +02:00
Wylabb 9f4bf2c3ee Support Anthropic subscription OAuth
Build Claw Telegram / build (push) Successful in 4m54s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-05 02:23:55 +02:00
Wylabb 6431bcac50 Require API key in Unraid gateway templates
Build Claw Telegram / build (push) Successful in 4m45s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-04 23:56:53 +02:00
Wylabb 5f0bda134e Make root Unraid template gateway-first 2026-04-04 23:44:14 +02:00
Wylabb 9e4030ccee Set explicit worker container entrypoint
Build Claw Telegram / build (push) Successful in 4m30s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-04 23:27:33 +02:00
Wylabb fb3e632c8c Document Telegram gateway operations 2026-04-04 23:23:39 +02:00
Wylabb 5eba6aedcf Fix Unraid standalone template value persistence 2026-04-04 22:33:45 +02:00
Wylabb 8a117b6def Show nested Telegram transport errors
Build Claw Telegram / build (push) Successful in 4m56s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-04 22:26:01 +02:00
Wylabb 8b7946b356 Auto-create gateway manifest on first boot
Build Claw Telegram / build (push) Successful in 5m12s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-04 22:12:26 +02:00
Wylabb 9b6d24118e Build both bot binaries in published image
Build Claw Telegram / build (push) Successful in 7m6s
Build Claw Telegram / cleanup (push) Successful in 1s
2026-04-04 22:00:34 +02:00
Wylabb a2001e9a93 Fix published image in Unraid template
Build Claw Telegram / cleanup (push) Has been cancelled
Build Claw Telegram / build (push) Has been cancelled
2026-04-04 21:55:35 +02:00
Wylabb 7558cace69 Make Unraid templates self-contained
Build Claw Telegram / cleanup (push) Has been cancelled
Build Claw Telegram / build (push) Has been cancelled
2026-04-04 21:50:35 +02:00
Wylabb 94fccd5356 Harden gateway worker coordination
Build Claw Telegram / build (push) Successful in 5m28s
Build Claw Telegram / cleanup (push) Successful in 0s
2026-04-04 20:52:12 +02:00
Wylabb f29d367888 Pin serde_with for Rust 1.86 builds
Build Claw Telegram / build (push) Successful in 5m25s
Build Claw Telegram / cleanup (push) Successful in 0s
2026-04-04 20:25:19 +02:00
Wylabb 246d4a7e90 Prefer OAuth token inheritance for workers
Build Claw Telegram / build (push) Failing after 1m34s
Build Claw Telegram / cleanup (push) Has been skipped
2026-04-04 20:18:02 +02:00
Wylabb 1c349197c6 Add Unraid Telegram gateway workers
Build Claw Telegram / build (push) Failing after 1m46s
Build Claw Telegram / cleanup (push) Has been skipped
2026-04-04 20:11:08 +02:00
ClaudeBot 3a6d1031ca fix(ci): bump Rust to 1.86 for edition2024 support
Build Claw Telegram / build (push) Successful in 7m51s
Build Claw Telegram / cleanup (push) Successful in 0s
The `home` crate v0.5.12 requires the edition2024 Cargo feature,
which was stabilized in Rust 1.85.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 18:29:59 +02:00
ClaudeBot 3ee9576c8c feat(ci): add Docker build workflow and Unraid template for claw-telegram
Build Claw Telegram / build (push) Failing after 52s
Build Claw Telegram / cleanup (push) Has been skipped
Publishes to git.wylab.me container registry on push to main/codex/**
branches. Includes Unraid DockerMan XML template with bot token, owner
ID, and Anthropic API key configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 18:15:57 +02:00
Wylabb cad6b1846b Add native Telegram bot runtime 2026-04-04 17:50:20 +02:00
Yeachan-Heo 8a9ea1679f feat(mcp+lifecycle): MCP degraded-startup reporting, lane event schema, lane completion hardening
Add MCP structured degraded-startup classification (P2.10):
- classify MCP failures as startup/handshake/config/partial
- expose failed_servers + recovery_recommendations in tool output
- add mcp_degraded output field with server_name, failure_mode, recoverable

Canonical lane event schema (P2.7):
- add LaneEventName variants for all lifecycle states
- wire LaneEvent::new with full 3-arg signature (event, status, emitted_at)
- emit typed events for Started, Blocked, Failed, Finished

Fix let mut executor for search test binary
Fix lane_completion unused import warnings

Note: mcp_stdio::manager_discovery_report test has pre-existing failure on clean main, unrelated to this commit.
2026-04-04 14:31:56 +00:00
Yeachan-Heo 639a54275d Stop stale branches from polluting workspace test signals
Workspace-wide verification now preflights the current branch against main so stale or diverged branches surface missing commits before broad cargo tests run. The lane failure taxonomy is also collapsed to the blocker classes the roadmap lane needs so automation can branch on a smaller, stable set of categories.

Constraint: Broad workspace tests should not run when main is ahead and would produce stale-branch noise
Rejected: Run workspace tests unconditionally | makes stale-branch failures indistinguishable from real regressions
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep workspace-test preflight scoped to broad test commands until command classification grows more precise
Tested: cargo test -p runtime stale_branch -- --nocapture; cargo test -p tools lane_failure_taxonomy_normalizes_common_blockers -- --nocapture; cargo test -p tools bash_workspace_tests_are_blocked_when_branch_is_behind_main -- --nocapture; cargo test -p tools bash_targeted_tests_skip_branch_preflight -- --nocapture
Not-tested: clean worktree cargo test --workspace still fails on pre-existing rusty-claude-cli tests default_permission_mode_uses_project_config_when_env_is_unset and single_word_slash_command_names_return_guidance_instead_of_hitting_prompt_mode
2026-04-04 14:01:31 +00:00
Jobdori fc675445e6 feat(tools): add lane_completion module (P1.3)
Implement automatic lane completion detection:
- detect_lane_completion(): checks session-finished + tests-green + pushed
- evaluate_completed_lane(): triggers CloseoutLane + CleanupSession actions
- 6 tests covering all conditions

Bridges the gap where LaneContext::completed was a passive bool
that nothing automatically set. Now completion is auto-detected.

ROADMAP P1.3 marked done.
2026-04-04 22:05:49 +09:00
Jobdori ab778e7e3a docs(ROADMAP): mark P1.2 and P1.4 as done
- P1.2: Cross-module integration tests — 12 tests landed
- P1.4: SummaryCompressor wiring — compress_summary_text() feeds
  into LaneEvent::Finished detail field

Both verified in codebase. P1.3 (lane-completion emitter) remains open.
2026-04-04 21:38:05 +09:00
Jobdori 11c418c6fa docs(ROADMAP): update P2 backlog with completion status and new gap
- P2.13: Mark session completion failure classification as done
  (WorkerFailureKind::Provider + observe_completion() + recovery bridge)
- P2.14: Add config merge validation gap (active bug being fixed in
  clawcode-issue-9507-claw-help-hooks-merge lane)

The config merge bug: deep_merge_objects() can produce non-string
values in hooks arrays, which fail validation in optional_string_array()
at claw --help time with 'field PreToolUse must contain only strings'.
2026-04-04 21:33:01 +09:00
Jobdori 8b2f959a98 test(runtime): add worker→recovery→policy integration test
Adds worker_provider_failure_flows_through_recovery_to_policy():
- Worker boots, sends prompt, encounters provider failure
- observe_completion() classifies as WorkerFailureKind::Provider
- from_worker_failure_kind() bridges to FailureScenario
- attempt_recovery() executes RestartWorker recipe
- Post-recovery context evaluates to merge-ready via PolicyEngine

Completes the P2.8/P2.13 wiring verification with a full cross-module
integration test. 660 tests pass.
2026-04-04 21:27:44 +09:00
Jobdori 9de97c95cc feat(recovery): bridge WorkerFailureKind to FailureScenario (P2.8/P2.13)
Connect worker_boot failure classification to recovery_recipes policy:

- Add FailureScenario::ProviderFailure variant
- Add FailureScenario::from_worker_failure_kind() bridge function
  mapping every WorkerFailureKind to a concrete FailureScenario
- Add RecoveryStep::RestartWorker for provider failure recovery
- Add recipe for ProviderFailure: RestartWorker -> AlertHuman escalation
- 3 new tests: bridge mapping, recipe structure, recovery attempt cycle

Previously a claw that detected WorkerFailureKind::Provider had no
machine-readable path to 'what should I do about this?'. Now it can
call from_worker_failure_kind() -> recipe_for() -> attempt_recovery()
as a single structured chain.

Closes the silo between worker_boot and recovery_recipes.
2026-04-04 20:07:36 +09:00
Jobdori 736069f1ab feat(worker_boot): classify session completion failures (P2.13)
Add WorkerFailureKind::Provider variant and observe_completion() method
to classify degraded session completions as structured failures.

- Detects finish='unknown' + zero tokens as provider failure
- Detects finish='error' as provider failure
- Normal completions transition to Finished state
- 2 new tests verify classification behavior

This closes the gap where sessions complete but produce no output,
and the failure mode wasn't machine-readable for recovery policy.

ROADMAP P2.13 backlog item added.
2026-04-04 19:37:57 +09:00
Jobdori 69b9232acf test(runtime): add cross-module integration tests (P1.2)
Add integration_tests.rs with 11 tests covering:

- stale_branch + policy_engine: stale detection flows into policy,
  fresh branches don't trigger stale rules, end-to-end stale lane
  merge-forward action
- green_contract + policy_engine: satisfied/unsatisfied contract
  evaluation, green level comparison for merge decisions
- reconciliation + policy_engine: reconciled lanes match reconcile
  condition, reconciled context has correct defaults, non-reconciled
  lanes don't trigger reconcile rules
- stale_branch module: apply_policy generates correct actions for
  rebase, merge-forward, warn-only, and fresh noop cases

These tests verify that adjacent modules actually connect correctly
— catching wiring gaps that unit tests miss.

Addresses ROADMAP P1.2: cross-module integration tests.
2026-04-04 17:05:03 +09:00
Jobdori 2dfda31b26 feat(tools): wire SummaryCompressor into lane.finished event detail
The SummaryCompressor (runtime::summary_compression) was exported but
called nowhere. Lane events emitted a Finished variant with detail: None
even when the agent produced a result string.

Wire compress_summary_text() into the Finished event detail field so that:
- result prose is compressed to ≤1200 chars / 24 lines before storage
- duplicate lines and whitespace noise are removed
- the event detail is machine-readable, not raw prose blob
- None is still emitted when result is empty/None (no regression)

This is the P1.4 wiring item from ROADMAP: 'Wire SummaryCompressor into
the lane event pipeline — exported but called nowhere; LaneEvent stream
never fed through compressor.'

cargo test --workspace: 643 pass (1 pre-existing flaky), fmt clean.
2026-04-04 16:35:33 +09:00
Jobdori d558a2d7ac feat(policy): add lane reconciliation events and policy support
Add terminal lane states for when a lane discovers its work is already
landed in main, superseded by another lane, or has an empty diff:

LaneEventName:
- lane.reconciled — branch already merged, no action needed
- lane.merged — work successfully merged
- lane.superseded — work replaced by another lane/commit
- lane.closed — lane manually closed

PolicyAction::Reconcile with ReconcileReason enum:
- AlreadyMerged — branch tip already in main
- Superseded — another lane landed the same work
- EmptyDiff — PR would be empty
- ManualClose — operator closed the lane

PolicyCondition::LaneReconciled — matches lanes that reached a
no-action-required terminal state.

LaneContext::reconciled() constructor for lanes that discovered
they have nothing to do.

This closes the gap where lanes like 9404-9410 could discover
'nothing to do' but had no typed terminal state to express it.
The policy engine can now auto-closeout reconciled lanes instead
of leaving them in limbo.

Addresses ROADMAP P1.3 (lane-completion emitter) groundwork.

Tests: 4 new tests covering reconcile rule firing, context defaults,
non-reconciled lanes not triggering reconcile rules, and reason
variant distinctness. Full workspace suite: 643 pass, 0 fail.
2026-04-04 16:12:06 +09:00
Yeachan-Heo ac3ad57b89 fix(ci): apply rustfmt to main 2026-04-04 02:18:52 +00:00
Jobdori 6e239c0b67 merge: fix render_diff_report test isolation (P0 backlog item) 2026-04-04 05:33:35 +09:00
Jobdori 3327d0e3fe fix(tests): isolate render_diff_report tests from real working-tree state
Replace with_current_dir+render_diff_report() with direct render_diff_report_for(&root)
calls in the three diff-report tests. The env_lock mutex only serializes within one
test binary; cargo test --workspace runs binaries in parallel, so set_current_dir races
were possible across binaries. render_diff_report_for(cwd) accepts an explicit path
and requires no global state mutation, making the tests reliably green under full
workspace parallelism.
2026-04-04 05:33:18 +09:00
Jobdori b6a1619e5f docs(roadmap): prioritize backlog — P0/P1/P2/P3 ordering with wiring items first 2026-04-04 04:31:38 +09:00
Jobdori da8217dea2 docs(roadmap): add backlog item #13 — cross-module integration tests 2026-04-04 03:31:35 +09:00
Jobdori e79d8dafb5 docs(roadmap): add backlog item #12 — wire SummaryCompressor into lane event pipeline 2026-04-04 03:01:59 +09:00
Jobdori 804f3b6fac docs(roadmap): add backlog item #11 — wire lane-completion emitter 2026-04-04 02:32:00 +09:00
Jobdori 0f88a48c03 docs(roadmap): add backlog item #10 — swarm branch-lock dedup 2026-04-04 01:30:44 +09:00