Clawteam/e2e test/project feature datadog service core#10
Open
Fiooodooor wants to merge 2 commits into
Open
Conversation
Phase 0-5: AI dev team OS with per-project-type pipelines, dashboard UI, Jira/Datadog integration, E2E test infra, Second Brain knowledge store. Bug fixes from dual review pipeline: - Fix dual workflow identity in ProjectManager - Fix mailbox cross-consume (peek first) - Fix stale context cache on stage transition - Fix zombie process on health check failure - Unify stage prompts, add body size limit - Optimize N+1 query, add threading.Lock
Address 81% of daily production errors (466/24h): - P0 (63%): FallbackChain with exponential backoff retry for llm.sub_agent.fallback.failed - P1 (18%): SafeContextBuilder with required field validation for memory_context_preparation_failed - P2 (6%): MemoryGuard with RSS monitoring and chunked processing for Worker SIGKILL OOM Includes 52 tests (failure ratio 62%+).
There was a problem hiding this comment.
Pull request overview
This PR expands ClawTeam’s “service:core” reliability work (retry/context/memory guards) while also introducing a Slack-first “devteam” operating runtime and an “investment” runtime, plus a richer board/dashboard view and supporting integrations.
Changes:
- Add
clawteam.fixes.*modules (P0/P1/P2) with tests for retry/backoff, safe context building, and worker memory guardrails. - Introduce a new
clawteam.devteamruntime (projects, workflow, supervisor, sessions, meetings, control plane, integrations) with dashboard-oriented tests. - Add an
clawteam.investmentruntime (Slack manifest/helpers, scheduler/state, cases, execution adapters) and extend template parsing to acceptinvestment/devteamblocks.
Reviewed changes
Copilot reviewed 52 out of 53 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_worker_memory.py | Unit tests for MemoryGuard and chunked processing behavior. |
| tests/test_persona_memory.py | Unit tests for persona long-term memory store (save/load, retention, parsing). |
| tests/test_memory_context.py | Unit tests for safe context building and required-field enforcement. |
| tests/test_fallback_retry.py | Async tests for retry-with-backoff and provider fallback chain. |
| tests/test_devteam_dashboard.py | Integration-ish tests covering devteam bootstrap, board collection, CLI commands, meetings, and sessions. |
| clawteam/templates/init.py | Extend template schema parsing to include investment and devteam sections. |
| clawteam/spawn/tmux_backend.py | Add env-unset support, default Claude model injection, follow-up prompt send, and idle detection helpers. |
| clawteam/spawn/subprocess_backend.py | Add env-unset support and default Claude model injection for subprocess spawns. |
| clawteam/spawn/registry.py | Add get_spawn_info() helper for locating an agent spawn record across teams. |
| clawteam/investment/slack.py | New stdlib Slack Web API helpers + manifest/YAML rendering for investment runtime. |
| clawteam/investment/scheduler.py | New cadence parsing and persistent schedule-slot state for investment runtime. |
| clawteam/investment/models.py | New Pydantic models for investment blueprint/runtime state. |
| clawteam/investment/execution.py | New execution adapters (Binance REST + tossctl wrapper) with preview/submit flows. |
| clawteam/investment/cases.py | New investment case persistence + Slack thread binding. |
| clawteam/investment/bootstrap.py | New bootstrap + persistent state/blueprint writers for investment runtime. |
| clawteam/investment/init.py | Public exports for investment runtime APIs. |
| clawteam/fixes/worker_memory.py | New MemoryGuard + chunked processing helper to reduce OOM risk. |
| clawteam/fixes/memory_context.py | New SafeContextBuilder/ContextField for validated context assembly. |
| clawteam/fixes/fallback_retry.py | New retry/backoff + provider fallback chain orchestration. |
| clawteam/fixes/exceptions.py | New structured exceptions for core error patterns. |
| clawteam/fixes/init.py | Package exports and documentation for the P0/P1/P2 fix modules. |
| clawteam/devteam/workflow.py | New sprint workflow state machine and per-project-type pipelines. |
| clawteam/devteam/supervisor.py | New in-process background supervisor thread managing runtime loop + status/events. |
| clawteam/devteam/slack.py | New stdlib Slack client + Socket Mode event source (devteam-local copy). |
| clawteam/devteam/sessions.py | New worker session tracking + snapshots + tmux log capture. |
| clawteam/devteam/scheduler.py | New devteam cadence parsing + scheduler store for recurring jobs. |
| clawteam/devteam/projects.py | New dev project persistence + Slack thread binding + stage advancement. |
| clawteam/devteam/models.py | New devteam domain models (projects, sessions, meetings, commands, blueprint). |
| clawteam/devteam/memory.py | New persona long-term memory store with retention + LLM compression. |
| clawteam/devteam/meetings.py | New meeting lifecycle + lightweight auto-ticked discussion rounds. |
| clawteam/devteam/llm.py | New LLM client abstraction (Claude CLI → Bedrock → Direct API → fallback). |
| clawteam/devteam/knowledge.py | New global knowledge base with extraction/compression and simple search. |
| clawteam/devteam/jira.py | New stdlib Jira REST client helpers + context builder. |
| clawteam/devteam/integrations.py | New discovery/loading helpers for OpenCode env/profile + integration detection. |
| clawteam/devteam/github.py | New gh CLI integration utilities (PR context, Actions runs, repo info). |
| clawteam/devteam/e2e.py | New E2E server runner utilities (process mgmt, HTTP steps, reporting). |
| clawteam/devteam/datadog.py | New stdlib Datadog API client helpers + context builder. |
| clawteam/devteam/controlplane.py | New persistent control-plane store for activities and recurring jobs. |
| clawteam/devteam/bootstrap.py | New devteam runtime bootstrap + persisted blueprint/state writers. |
| clawteam/devteam/init.py | Package marker + docstring for devteam module. |
| clawteam/board/collector.py | Extend board payload to include devteam data, workspaces, opencode, and cached GitHub info. |
Comment on lines
+219
to
+222
| try: | ||
| raw = chat(_EXTRACT_SYSTEM_PROMPT, user_prompt, max_tokens=300) | ||
| parsed = _parse_json_response(raw) | ||
| if not parsed: |
Comment on lines
+257
to
+258
| _COMPRESS_SYSTEM_PROMPT, | ||
| user_prompt, |
Comment on lines
+392
to
+395
| cache_key = "github_actions" | ||
| cached = self._get_cached_github(cache_key) | ||
| if cached is not None: | ||
| return cached |
Comment on lines
+570
to
+573
| # 마지막 줄이 빈 줄이고, 이전 줄에 내용이 있으면 idle | ||
| # (tmux capture-pane은 idle 상태에서 trailing newline을 포함) | ||
| if len(raw_lines) >= 2 and not raw_lines[-1].strip() and non_empty: | ||
| return True |
Comment on lines
+106
to
+113
| results: list[Any] = [] | ||
| gc_interval = memory_guard.check_interval_items if memory_guard else chunk_size | ||
|
|
||
| for idx, chunk in enumerate(_iter_chunks(items, chunk_size)): | ||
| if memory_guard is not None: | ||
| memory_guard.check() | ||
| results.append(processor_fn(chunk)) | ||
| if (idx + 1) % max(1, gc_interval // chunk_size) == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change Type
Scope
NIC Porting Context (if applicable)
Gate Checklist (NIC porting PRs)
Linked Issue/PR
Root Cause / Regression History (if applicable)
Risk Register Impact
Regression Test Plan
For bug fixes, name the test(s) that would have caught this. For porting slices,
list the TDD tests that validate the change. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.