Skip to content

feat: upstream port v2.6→v3.8.5 + skill & workflow upgrade#31

Merged
codewithkenzo merged 36 commits intomainfrom
feat/upstream-port-v3.8.5
Feb 26, 2026
Merged

feat: upstream port v2.6→v3.8.5 + skill & workflow upgrade#31
codewithkenzo merged 36 commits intomainfrom
feat/upstream-port-v3.8.5

Conversation

@codewithkenzo
Copy link
Copy Markdown
Owner

Summary

Complete upstream port of oh-my-opencode v2.6→v3.8.5 features into the Kenzo fork, plus a skill & workflow upgrade layer on top. 36 commits, 197 files changed.

Upstream Port (35 commits)

Phase 1 — Foundation

  • .sisyphus.musashi rename across entire codebase
  • 18 broken skill names fixed in CATEGORY_SKILLS
  • Background-first delegation and kenzo-* skill priority enforced in agent prompts

Phase 2 — Tools & Config

  • Hashline-edit tool + tool-metadata-store ported
  • MODEL_VERSION_MAP auto-migration (opus-4-5 → opus-4-6)
  • safeCreateHook utility + experimental config fields

Phase 3 — Hooks

  • 6 upstream hooks ported: hashline-read-enhancer, hashline-edit-diff-enhancer, write-existing-file-guard, anthropic-effort, unstable-agent-babysitter, runtime-fallback (13 files)
  • Comment-checker extended with apply_patch support
  • 6 new hooks wired into plugin registration

Phase 4 — Agents

  • Intent verbalization in Musashi + trust-no-one verification in Atlas
  • Display name mapping for all agents
  • Cascade cancel for background child sessions
  • /handoff context continuity command

Phase 5 — Agent Architecture

  • Dynamic-agent-prompt-builder for metadata-driven prompt sections
  • AgentMode type + model detection upgrades
  • D5 backend-builder enhanced with completion guarantee
  • Atlas modularized into model-specific prompt variants

Phase 6 — Infrastructure

  • SQLite backend detection with flat-file fallback
  • Tool metadata store
  • Task tool ported alongside delegate-task
  • TmuxConfigSchema with layout options

Phase 7 — Agent Identity

  • kenzo-* skills assigned to R2, T4, D5 metadata
  • K9 advisor upgraded with upstream Oracle improvements
  • Agent skill specializations shown in Musashi prompt

Skill & Workflow Upgrade (squash-merged from PR #30)

  • Enforcement hooks: ticket-enforcement, verification-before-completion, skill-auto-invoke, todo-ticket-bridge (all default to "warn")
  • Git worktree tools: worktree_list, worktree_create, worktree_remove, worktree_switch
  • Safety hooks: rm-to-trash (intercepts rmmv to trash)
  • Slash commands: /brainstorm, /worktree, /review, /debug, /verify, /finish
  • Agent prompts: Verification + Skill Awareness sections, TDD Discipline for builders
  • Test pollution fix: mock.module() conditional gate pattern for Bun tests

Test results

1642 pass, 0 fail, 1 skip, 132 test files, 4662 expect() calls

codewithkenzo and others added 30 commits February 25, 2026 00:38
…ll priority

- All delegate_task examples now use run_in_background=true in Musashi and Atlas prompts
- Removed 'NEVER background' from Atlas critical overrides, added monitoring workflow
- kenzo-* skill prioritization instruction added to buildSkillsReference and delegation guide
- DELEGATE_TASK_DESCRIPTION mandates background=true as default
- Expanded CATEGORY_SKILLS: kenzo-zustand/kenzo-tanstack-query in ultrabrain, kenzo-agents-md in quick, kenzo-tanstack-start/kenzo-zustand/kenzo-tanstack-query in most-capable, kenzo-agents-md/kenzo-deployment in general
- Updated test assertions to match new default
- Updated AGENTS.md knowledge bases

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…ft skill validation

- Renamed 18 skills missing kenzo-* prefix (e.g., blueprint-architect → kenzo-blueprint-architect)
- Changed hard-fail skill validation to soft skip with console.warn
- Missing skills no longer block entire delegation
- Removed unused discoverSkills import

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Rename all references to the .sisyphus working directory to .musashi,
aligning with the fork's agent naming convention (Musashi orchestrator).

- 33 files updated: constants, functions, variables, config keys, prompts,
  hooks, tests, schema, and .gitignore
- Added sisyphus_agent → musashi_agent config migration
- Rebuilt JSON schema

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…eam v3.8.5

Port the complete hashline-edit tool (26 files) and its dependency
tool-metadata-store from upstream. CID-based hashing for precise line
targeting with batch mismatch reporting.

- 27 files in src/tools/hashline-edit/ (26 upstream + def.ts for lazy loading)
- 2 files in src/features/tool-metadata-store/
- Registered in core tool profile with lazy loading
- Added diff + @types/diff dependencies
- 77 tests passing

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Port safeCreateHook for error-safe hook creation and add
plugin_load_timeout_ms + safe_hook_creation experimental config fields.

- safeCreateHook wraps hook factories in try/catch, returns null on failure
- plugin_load_timeout_ms: configurable plugin load timeout (min 1000ms)
- safe_hook_creation: toggle for safe hook wrapping (default true at call site)
- 5 tests for safeCreateHook, 4 tests for config fields

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Add model version migration that auto-upgrades old model strings in
user configs (opus-4-5 → opus-4-6, sonnet-4-5 → sonnet-4-6).

- MODEL_VERSION_MAP + migrateModelVersions in migration.ts
- Wired into migrateConfigFile for agents and categories sections
- _migrations tracking prevents re-applying reverted changes
- 6 new tests (50 total in migration.test.ts)

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…-edit-diff-enhancer, write-existing-file-guard, anthropic-effort, unstable-agent-babysitter, runtime-fallback

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…mode Gemini preview entries

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…fication to Atlas

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…entation

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
When a parent session is deleted, cascade-cancel all descendant tasks instead of only the directly-matched task. Uses getAllDescendantTasks() to collect direct + descendant tasks into a deduped Map, cancels both running and pending tasks.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
OpenCode fires both session.status {type:idle} and session.idle events. Add 500ms dedup window via normalizeSessionIdleEvent() so hooks and background manager only fire once per actual idle.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add /handoff command that gathers session context, git state, and todos to generate a structured handoff summary for session continuity. Registered in builtin commands and config schema.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add full_session, include_thinking, include_tool_results, message_limit, since_message_id, thinking_max_chars args to background_output. Auto-enables full_session mode for running/pending tasks. Adds formatFullSession() for filtered session message output.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Skill tool now falls back to slash command discovery when a skill name isn't found. Keeps slashcommand tool as backward-compatible wrapper. Skills take priority over commands in resolution order.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove unused imports, parameters, and field declarations found during
Phase 5.1 dead code purge across files modified in Phases 1-4:

- src/agents/utils.ts: unused createMomusAgent import
- src/config/schema.ts: unused McpNameSchema import
- src/hooks/comment-checker/index.ts: unused input parameter
- src/index.ts: unused getModelLimit, createCompactionContextInjector
- src/tools/hashline-edit/edit-operation-primitives.ts: unused import
- src/tools/hashline-edit/validation.ts: unused private field declarations

Co-authored-by: Musashi <sisyphus@codewithkenzo.com>
Update all four AGENTS.md files to reflect upstream port changes:

- Root AGENTS.md: 37 hooks, 103 tools, hashline-edit + /handoff in
  where-to-look, runtime-fallback in complexity hotspots, 118 test files
- src/hooks/AGENTS.md: 6 new hooks added to directory listing
- src/tools/AGENTS.md: hashline-edit tool, slash→skill merge note
- src/features/AGENTS.md: handoff command, cascade cancel, background
  visibility flags, session idle dedup

Co-authored-by: Musashi <sisyphus@codewithkenzo.com>
- Add AgentMode union type ('default' | 'plan' | 'review' | 'debug')

- Add isGeminiModel() detection utility

- Enhance isGptModel() with broader pattern matching

- Add fallback_models to AgentOverrideConfig

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ections

- 12 exported builder functions for agent/tool/skill/category sections

- All upstream names translated (Sisyphus→Musashi, Oracle→K9, etc.)

- Generates markdown sections from AgentPromptMetadata

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…d intent mapping

- Port 5 Hephaestus patterns: intent mapping, do-not-ask, completion guarantee, turn-end self-check, evidence requirement

- D5 prompt grows 240→312 lines with upstream completion discipline

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…tries

- Bump model versions: claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-6, gpt-5.3-codex

- Add free-tier models: kimi-k2.5-free, minimax-m2.5-free

- Extend ModelRequirement type: requiresModel, requiresAnyModel, requiresProvider

- Add T4 frontend-builder and deep category entries

- Update R2/X1 fallback chains, fix test assertions (24/24 pass)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Split monolithic atlas.ts into src/agents/atlas/ directory (6 files)

- Router (agent.ts) selects prompt variant by model: default, GPT, Gemini

- GPT/Gemini variants compose as PREFIX + default prompt (no duplication)

- Add prompt-section-builder.ts for reusable section generation

- Add merge-categories.ts shared utility for category merging

- Update import paths in agents/index.ts and agents/utils.ts

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add isSqliteBackend() with 3-state cache (NOT_CACHED, FALSE_PENDING_RETRY, true)

- Detects OpenCode >= 1.1.53 + opencode.db file existence

- Add resetSqliteBackendCache() for testing

- Tests use real temp directories (no global fs mocks)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Preserves metadata across fromPlugin() overwrites via Map+TTL store

- storeToolMetadata/consumeToolMetadata with 15-min stale cleanup

- Tests cover store/consume cycle, stale cleanup, clear, size

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add src/tools/task/ with CRUD tools: create, get, list, update

- Add src/features/claude-tasks/storage.ts with atomic JSON writes and file locking

- Todo sync bridges task status to OpenCode Todo API

- Coexists with delegate-task — does NOT replace it

- Translated config access: sisyphus.tasks → musashi_agent.tasks

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add TmuxLayoutSchema: main-horizontal, main-vertical, tiled, even-horizontal, even-vertical

- Add TmuxConfigSchema: enabled, layout, main_pane_size, min widths

- Wire tmux into OhMyOpenCodeConfigSchema

- Rebuild JSON schema

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Skills declared in agent metadata (e.g. K9's systematic-debugging,
R2's docs-seeker) were never resolved or injected into agent prompts.
Add ~8 lines in createBuiltinAgents() to resolve metadata skills via
resolveMultipleSkills() and prepend to agent system prompt at boot.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
codewithkenzo and others added 6 commits February 26, 2026 03:49
Add 5 new guidance sections from upstream Oracle prompt:
- Output Verbosity Constraints (strict length limits)
- Uncertainty & Ambiguity Handling (hedged claims, clarifying Qs)
- Long Context Handling (anchor to specific locations)
- Scope Discipline (no unsolicited improvements)
- High-Risk Self-Check (verify claims before finalizing)

Also update working-with-tools for proactive research, support
session continuation for follow-ups, and add kenzo-blueprint-architect
+ kenzo-backend-debugging to K9 metadata skills.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Add domain-specific kenzo-* skills to agent prompt metadata:
- R2: kenzo-research-tools, kenzo-seo-geo
- T4: kenzo-frontend-stack, kenzo-component-stack, kenzo-tailwind,
      kenzo-motion-system
- D5: kenzo-blueprint-architect, kenzo-effect-ts, kenzo-zod-patterns,
      kenzo-testing-stack

These are resolved at boot by the skill loading fix (d43c098) and
prepended to each agent's system prompt automatically.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Add dynamic 'Agent Skill Specializations' table to buildDelegationTable()
in sisyphus-prompt-builder.ts. Table is generated from agent metadata
skills at runtime — agents with no skills (X1) are auto-skipped.

Helps Musashi make informed delegation decisions based on each agent's
domain expertise without hardcoding.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Add AGENT SKILL ASSIGNMENTS section to src/agents/AGENTS.md documenting
metadata skills for K9, R2, T4, D5. Update KEY PATTERNS with skill
loading and specialization table entries. Update root AGENTS.md test
counts (118→126 files, ~1604 total) and add metadata skills note.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Update 5 legacy agent name references in /refactor command template:
- oracle → K9 - advisor
- librarian → R2 - researcher

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
…commands

* feat(config): add enforcement policy and worktree config schema

Add EnforcementConfigSchema with 5 enforcement levels (ticket_tracking,
rm_safety, verification_gate, skill_auto_invoke, write_file_guard) all
defaulting to 'warn' mode. Add WorktreeConfigSchema with git worktree
lifecycle settings (enabled, base_dir, branch_prefix, auto_create,
auto_cleanup). Register 5 new hook names in HookNameSchema. Rebuild
JSON schema.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* feat(hooks): add rm-to-trash safety hook

PreToolUse hook on Bash tool that intercepts dangerous rm commands.
Always blocks catastrophic patterns (rm -rf /, rm ~, rm $HOME).
Allows safe cleanup (node_modules, dist, .cache, .turbo, coverage).
Warns or blocks based on enforcement config (default: warn).
Skips package manager commands and CI environments.
Platform-aware trash suggestions (trash-put on Linux, trash on macOS).

10 tests covering warn/block/off modes and edge cases.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* feat(tools): add git worktree management tool

4 operations: create, list, remove, status. Lazy-loaded in core profile.
Includes Bun.spawn-based git worktree commands, porcelain parser, dirty
working tree detection, and 6 unit tests.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* refactor(hooks): todo-enforcer boulder-only gate + permanent Esc cancel

- Only fires when .musashi/boulder.json has active_plan (no more false triggers)
- Esc/abort permanently stops injection until user re-engages
- Configurable countdownSeconds (tests use 0 for speed: 3.4s vs 45s timeout)
- 31 tests, all pass in isolation (pre-existing suite pollution unrelated)

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* fix(tests): update model version expectations to opus-4-6

MODEL_VERSION_MAP migrated opus-4-5 to opus-4-6 but tests still expected old version.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* feat(boulder): wire worktree lifecycle into /start-work

- Add optional worktree_path to BoulderState type
- /start-work template now instructs agent to create worktree when config enabled
- Resumed plans verify existing worktree via worktree_status
- All delegate_task calls inherit worktree cwd when active
- Skips entirely when worktree config disabled (no breaking change)

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* feat(hooks): add ticket-enforcement hook

PreToolUse hook enforcing active ticket before code changes (Write/Edit/Bash).
Session-scoped tracking via markTicketActive(), auto-marks on ticket_start.
Bypasses read-only tools, ticket tools, and off enforcement. 7 BDD tests.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* feat(hooks): add verification-before-completion hook

PostToolUse hook tracking test/typecheck execution per session.
Exposes getVerificationState() and getReminder() for other hooks to consume.
Session-scoped Map, respects enforcement off/warn. 6 BDD tests.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* feat(hooks): add skill-auto-invoke and todo-ticket-bridge hooks

skill-auto-invoke: chat.message hook injecting skill awareness mandate on first
message per session. Advisory only (off/warn), skips subagents. 4 BDD tests.

todo-ticket-bridge: PostToolUse hook on todowrite suggesting ticket creation
when 2+ todos written. Advisory only (off/warn). 5 BDD tests.

Wires all 4 Phase 3 hooks into src/index.ts event handlers.

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>

* fix(tests): prevent mock.module() pollution across test files

Add conditional gate flags to mock.module() calls in opencode-storage-detection and atlas test files. When the polluter's own tests are not running, mocks delegate to real functions instead of returning stale closure values. Fixes 19 test failures (3 in opencode-version, 13 in todo-continuation-enforcer, 3 in unstable-agent-babysitter) that only manifested in full suite runs.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat(commands): add /brainstorm, /worktree, /review, /debug, /verify, /finish commands

Six new slash commands for the skill-workflow-upgrade plan Phase 4. Each command injects a structured prompt template guiding the agent through a specific workflow.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat(agents): add verification, skill awareness, and TDD discipline to agent prompts

Musashi gets completion evidence (3 lines) and skill-first workflow (2 lines) sections. D5 and T4 builders get TDD discipline reminder (2 lines each). Light-touch prompt reinforcements complementing existing hooks.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

---------

Co-authored-by: Sisyphus <sisyphus@codewithkenzo.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actions
Copy link
Copy Markdown

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).

To sign the CLA, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA

This is a one-time requirement. Once signed, all your future contributions will be automatically accepted.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 26, 2026

Greptile Summary

Complete upstream port of oh-my-opencode v2.6→v3.8.5 (35 commits) plus skill & workflow upgrade layer. Major additions:

Infrastructure (High Quality)

  • Runtime fallback system with model switching on 429/503/529 errors, cooldown tracking, and cascade cancel for nested background tasks
  • 6 enforcement hooks (ticket tracking, rm-to-trash, verification gate, skill auto-invoke) all default to "warn" mode
  • Git worktree tools with create/list/remove/status operations
  • Hashline-edit tool with hash validation and diff enhancement
  • Dynamic agent prompt builder with metadata-driven sections

Migration & Config (Solid)

  • Comprehensive v2.6→v3.8.5 migration with automatic backups and model version upgrades (opus-4-5opus-4-6)
  • Schema extensions for all new hooks, properly typed with Zod
  • Agent name normalization (Sisyphus→Musashi, Oracle→K9, etc.)

Test Coverage (Excellent)

  • 1642 passing tests across 133 test files
  • Cascade cancel, runtime fallback, enforcement hooks all covered

Issue Found

  • hashline-edit-executor.ts:132-135 — rename doesn't check if target exists, will silently overwrite

Confidence Score: 4/5

  • Safe to merge after fixing rename overwrite issue in hashline-edit-executor.ts
  • Excellent test coverage (1642 passing), well-structured architecture, comprehensive migration logic. One logic bug found (file rename can silently overwrite) prevents 5/5 score, but otherwise implementation quality is high
  • src/tools/hashline-edit/hashline-edit-executor.ts (rename logic needs fix)

Important Files Changed

Filename Overview
src/hooks/runtime-fallback/event-handler.ts Handles session lifecycle events for model fallback on errors. Proper cleanup on session.deleted/stop, correct error detection and retry logic.
src/features/background-agent/manager.ts Cascade cancel for nested background tasks implemented correctly. Collects all descendants before cleanup to prevent dangling tasks.
src/tools/hashline-edit/hashline-edit-executor.ts File editing with hash validation and rename support. Missing check for existing file at rename target path (lines 132-135) could cause silent overwrite.
src/hooks/ticket-enforcement/hook.ts Enforces ticket tracking before code changes. Proper tool filtering, session state management, and enforcement level handling.
src/tools/worktree/tools.ts Git worktree management with create/list/remove/status operations. Proper error handling, branch detection, and dirty-state checking.
src/agents/atlas/agent.ts Model-specific orchestrator prompt builder. Clean separation of GPT/Gemini/default prompts, proper tool restrictions applied.
src/shared/migration.ts Config migration from v2.6 to v3.8.5. Comprehensive name mapping, automatic model version upgrades, proper backup before write.
src/config/schema.ts Schema additions for new hooks and features. All properly typed with Zod, sensible defaults, backward compatibility maintained.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start[User Request] --> Atlas[Atlas Orchestrator]
    Atlas --> Delegate[delegate_task]
    
    Delegate --> SkillCheck{Skill Available?}
    SkillCheck -->|Yes| InvokeSkill[Invoke Skill]
    SkillCheck -->|No| AgentSelect[Select Agent by Category]
    
    AgentSelect --> Background[Background Manager]
    Background --> Concurrency{Check Concurrency}
    Concurrency -->|Slot Available| Launch[Launch Agent Session]
    Concurrency -->|Queue Full| Queue[Queue Task]
    
    Launch --> Execute[Execute Task]
    Execute --> Error{Session Error?}
    Error -->|429/503/529| Fallback[Runtime Fallback]
    Error -->|Other| Fail[Report Error]
    Error -->|Success| Complete[Task Complete]
    
    Fallback --> FallbackState{Fallback Available?}
    FallbackState -->|Yes| Retry[Retry with Fallback Model]
    FallbackState -->|Max Attempts| Fail
    Retry --> Execute
    
    Complete --> Verify{Verification Hook}
    Verify -->|Tests Run| AtlasResult[Return to Atlas]
    Verify -->|No Tests| Warn[Warn Missing Verification]
    Warn --> AtlasResult
    
    AtlasResult --> MoreTasks{More Tasks?}
    MoreTasks -->|Yes| Delegate
    MoreTasks -->|No| Done[All Tasks Complete]
    
    Launch -.->|session.deleted| CascadeCancel[Cascade Cancel]
    CascadeCancel --> Descendants[Cancel All Descendants]
    Descendants --> Cleanup[Cleanup State]
Loading

Last reviewed commit: c54a168

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

196 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +132 to +135
if (rename && rename !== filePath) {
await Bun.write(rename, writeContent)
await Bun.file(filePath).delete()
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

rename target path not checked for existence — will silently overwrite if file already exists at rename path

Suggested change
if (rename && rename !== filePath) {
await Bun.write(rename, writeContent)
await Bun.file(filePath).delete()
}
if (rename && rename !== filePath) {
const renameFile = Bun.file(rename)
if (await renameFile.exists()) {
return `Error: Rename target already exists: ${rename}`
}
await Bun.write(rename, writeContent)
await Bun.file(filePath).delete()
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/tools/hashline-edit/hashline-edit-executor.ts
Line: 132-135

Comment:
rename target path not checked for existence — will silently overwrite if file already exists at `rename` path

```suggestion
    if (rename && rename !== filePath) {
      const renameFile = Bun.file(rename)
      if (await renameFile.exists()) {
        return `Error: Rename target already exists: ${rename}`
      }
      await Bun.write(rename, writeContent)
      await Bun.file(filePath).delete()
    }
```

How can I resolve this? If you propose a fix, please make it concise.

@codewithkenzo codewithkenzo merged commit 7bd173a into main Feb 26, 2026
1 of 2 checks passed
@codewithkenzo codewithkenzo deleted the feat/upstream-port-v3.8.5 branch February 26, 2026 08:51
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