Commit Graph

395 Commits

Author SHA1 Message Date
YeonGyu-Kim
7938316a61 fix(background-task): return result instead of status for completed tasks
- Fix background_output to check completion status before block flag
- Update call_omo_agent return message to correctly indicate block=false as default
- Add system notification guidance in return message

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-14 10:44:54 +09:00
YeonGyu-Kim
b00b8238f4 fix(background-task): gracefully handle agent not found errors
When an invalid or unregistered agent is passed to background_task or
call_omo_agent, OpenCode crashes with "TypeError: undefined is not an
object (evaluating 'agent.name')". This fix:

- Validates agent parameter is not empty before launching
- Catches prompt errors and returns friendly error message
- Notifies parent session when background task fails
- Improves error message to guide user on resolution

Fixes #37

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-14 01:23:44 +09:00
YeonGyu-Kim
ed66ba5f55 fix antigravity refreshing 2025-12-14 01:14:21 +09:00
YeonGyu-Kim
27403f2682 feat(agents): enhance orchestration prompt and inject to all non-subagent agents
- Add mandatory parallel tool calls section
- Add mandatory 7-section subagent prompt structure guide
- Inject BUILD_AGENT_PROMPT_EXTENSION to all non-subagent agents (not just 'build')
- Fixes issue where custom primary agents don't receive orchestration guidance

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 23:14:25 +09:00
YeonGyu-Kim
b24b00fad2 feat(agents): add build agent prompt extension and configuration override support
- Add BUILD_AGENT_PROMPT_EXTENSION for orchestrator-focused main agent behavior
- Introduce OverridableAgentName type to allow build agent customization
- Update config schema to support build agent override in oh-my-opencode.json
- Inject orchestration prompt into build agent's system prompt

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 22:13:23 +09:00
YeonGyu-Kim
f3b2fccba7 fix(hooks): fix agent-usage-reminder case-sensitivity bug in tool name matching
- Change TARGET_TOOLS and AGENT_TOOLS to Set<string> for O(1) lookup
- Normalize tool names to lowercase for case-insensitive comparison
- Remove unnecessary parentSessionID guard that blocked main session triggers
- Fixes issue where Glob/Grep tool calls weren't showing agent usage reminder

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 22:13:02 +09:00
YeonGyu-Kim
2c6dfeadce feat(hooks): add agent-usage-reminder hook for background agent recommendations
Implements hook that tracks whether explore/librarian agents have been used in a session.
When target tools (Grep, Glob, WebFetch, context7, websearch_exa, grep_app) are called
without prior agent usage, appends reminder message recommending parallel background_task calls.

State persists across tool calls and resets on session compaction, allowing fresh reminders
after context compaction - similar to directory-readme-injector pattern.

Files:
- src/hooks/agent-usage-reminder/: New hook implementation
  - types.ts: AgentUsageState interface
  - constants.ts: TARGET_TOOLS, AGENT_TOOLS, REMINDER_MESSAGE
  - storage.ts: File-based state persistence with compaction handling
  - index.ts: Hook implementation with tool.execute.after and event handlers
- src/config/schema.ts: Add 'agent-usage-reminder' to HookNameSchema
- src/hooks/index.ts: Export createAgentUsageReminderHook
- src/index.ts: Instantiate and register hook handlers

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 21:47:56 +09:00
YeonGyu-Kim
64b53c0e1c feat(background-task): improve status output UX
- Remove always-zero tool call count from status display
- Show last tool only when available
- Add status-specific notes:
  - running: remind no explicit wait needed (system notifies)
  - error: indicate task failed, check last message

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 20:52:35 +09:00
YeonGyu-Kim
3caa84f06b feat(agents): explicitly allow read/bash tools for subagents
- oracle: allow read, call_omo_agent
- explore: allow bash, read
- librarian: allow bash, read

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 20:22:56 +09:00
Nguyen Quang Huy
ab522aff1a fix: add multimodal-looker to Zod config schema (#36)
The agent was missing from AgentNameSchema and AgentOverridesSchema,
causing model overrides in oh-my-opencode.json to be silently dropped.

Co-authored-by: Amp <amp@ampcode.com>
2025-12-13 19:47:35 +09:00
YeonGyu-Kim
3f28ce52ad librarian now leverages grep.app 2025-12-13 19:44:36 +09:00
YeonGyu-Kim
9575a4b5c0 change wrong model name
yes this is ai slop
2025-12-13 19:44:36 +09:00
YeonGyu-Kim
098d023dba feat(mcp): add grep_app builtin MCP for ultra-fast GitHub code search
- Add grep_app MCP configuration (https://mcp.grep.app)
- Update explore agent with grep_app usage guide:
  - Always launch 5+ grep_app calls with query variations
  - Always add 2+ other search tools for verification
  - grep_app is fast but potentially outdated, use as starting point only
- Update README.md and README.ko.md with grep_app documentation

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 19:14:01 +09:00
YeonGyu-Kim
a7507ab43d feat(agents): change librarian model from Haiku to Sonnet
Upgrade librarian agent to use claude-sonnet-4 instead of claude-haiku-4-5
for improved code search and documentation capabilities.

Closes #22

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 19:06:01 +09:00
YeonGyu-Kim
a3938e8c25 feat: add look_at tool and multimodal-looker agent
Add a new tool and agent for analyzing media files (PDFs, images, diagrams)
that require visual interpretation beyond raw text.

- Add `multimodal-looker` agent using Gemini 2.5 Flash model
- Add `look_at` tool that spawns multimodal-looker sessions
- Restrict multimodal-looker from calling task/call_omo_agent/look_at tools

Inspired by Sourcegraph Ampcode's look_at tool design.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 15:28:59 +09:00
Junho Yeo
1323443c85 refactor: extract shared utilities (isMarkdownFile, isPlainObject, resolveSymlink) (#33) 2025-12-13 14:23:04 +09:00
YeonGyu-Kim
55bc8f08df refactor(ultrawork-mode): use history injection instead of direct message modification
- Replace direct parts[idx].text modification with injectHookMessage
- Context now injected via filesystem (like UserPromptSubmitHook)
- Preserves original user message without modification

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 14:05:17 +09:00
YeonGyu-Kim
0ac4d223f9 feat(think-mode): inject thinking config with maxTokens for extended thinking
- Actually inject THINKING_CONFIGS into message (was defined but unused)
- Add maxTokens: 128000 for Anthropic (required for extended thinking)
- Add maxTokens: 64000 for Amazon Bedrock
- Track thinkingConfigInjected state

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 14:05:02 +09:00
Junho Yeo
564c8ae8bf fix: use lstatSync instead of statSync for symlink detection (#32) 2025-12-13 13:58:02 +09:00
YeonGyu-Kim
f57aa39d53 feat(hooks): add ultrawork-mode hook for automatic agent orchestration guidance
When "ultrawork" or "ulw" keyword is detected in user prompt:
- Injects ULTRAWORK_CONTEXT with agent-agnostic guidance
- Executes AFTER CC hooks (UserPromptSubmit etc.)
- Follows existing hook pattern (think-mode style)

Key features:
- Agent orchestration principles (by capability, not name)
- Parallel execution rules
- TODO tracking enforcement
- Delegation guidance

Closes #31

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 13:44:34 +09:00
YeonGyu-Kim
41a318df66 fix(background-task): send notification to parent session instead of main session
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 13:36:31 +09:00
YeonGyu-Kim
e533a35109 feat(antigravity): add GCP permission error retry with exponential backoff
- Add retry logic for 403 GCP permission errors (max 10 retries)
- Implement exponential backoff with 2s cap (200ms → 400ms → 800ms → 2000ms)
- Detect patterns: PERMISSION_DENIED, Cloud AI Companion API not enabled, etc.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 13:26:25 +09:00
YeonGyu-Kim
91ae0cc67d feat(background-task): show original prompt and last message in running task status
- Add prompt field to BackgroundTask to store original prompt
- Add lastMessage/lastMessageAt to TaskProgress for real-time monitoring
- Extract last assistant message during polling
- Update formatTaskStatus() to display prompt (truncated 300 chars) and
  last message (truncated 500 chars) with timestamp

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 13:26:25 +09:00
YeonGyu-Kim
7859f0dd2d fix(hooks): add session-notification to disabled_hooks with race/memory fixes
- Add session-notification to HookNameSchema and schema.json
- Integrate session-notification into disabled_hooks conditional creation
- Fix race condition with version-based invalidation
- Fix memory leak with maxTrackedSessions cleanup
- Add missing activity event types (message.created, tool.execute.*)
- Document disabled_hooks configuration in README

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 13:26:25 +09:00
Claude
e131491db4 feat(config): add disabled_hooks option for selective hook disabling
Allow users to individually disable built-in hooks via the
`disabled_hooks` configuration option in oh-my-opencode.json.

This addresses issue #28 where users requested the ability to
selectively disable hooks (e.g., comment-checker) that may
conflict with their workflow.

Available hooks:
- todo-continuation-enforcer
- context-window-monitor
- session-recovery
- comment-checker
- grep-output-truncator
- directory-agents-injector
- directory-readme-injector
- empty-task-response-detector
- think-mode
- anthropic-auto-compact
- rules-injector
- background-notification
- auto-update-checker

Closes #28
2025-12-13 13:26:25 +09:00
YeonGyu-Kim
555abbc0d6 fix(google-auth): integrate into main package via config option
Fixes #30. OpenCode's plugin loader treats subpath exports like
"oh-my-opencode/google-auth" as separate npm packages, causing
BunInstallFailedError.

Solution: Enable Google auth via `google_auth: true` in
oh-my-opencode.json instead of a separate subpath plugin.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 12:14:51 +09:00
Junho Yeo
3b129f11c4 fix(config): deep merge agent overrides with reusable deepMerge utility (#27) 2025-12-13 12:00:38 +09:00
Junho Yeo
2cab36f06d fix(hooks): prevent infinite loop when todo-continuation-enforcer runs during session recovery (#29) 2025-12-13 11:48:22 +09:00
YeonGyu-Kim
5608bd0ef9 fix(antigravity): improve streaming retry logic and implement true SSE streaming
- Add isRetryableResponse() to detect SUBSCRIPTION_REQUIRED 403 errors for retry handling
- Remove JSDoc comments from isRetryableError() for clarity
- Add debug logging for request/response details (streaming flag, status, content-type)
- Refactor transformStreamingResponse() to use TransformStream for true streaming
  - Replace buffering approach with incremental chunk processing
  - Implement createSseTransformStream() for line-by-line transformation
  - Reduces memory footprint and Time-To-First-Byte (TTFB)
- Update SSE content-type detection to include alt=sse URL parameter
- Simplify response transformation logic for non-streaming path
- Add more granular debug logging for thought signature extraction

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 04:50:11 +09:00
YeonGyu-Kim
abd90bbc9c fix(antigravity): use loadCodeAssist project ID and add OpenAI message conversion
- Add message-converter.ts for OpenAI messages to Gemini contents conversion
- Use SKIP_THOUGHT_SIGNATURE_VALIDATOR as default signature (CLIProxyAPI approach)
- Restore loadCodeAssist API call to get user's actual project ID
- Improve debug logging for troubleshooting
- Fix tool normalization edge cases

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 04:24:24 +09:00
YeonGyu-Kim
7fe85a11da fix(session-recovery): handle API/storage index mismatch in empty message recovery
- Try both targetIndex and targetIndex-1 to handle system message offset
- Remove 'last assistant message' skip logic (API error means it's not final)

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 04:16:42 +09:00
YeonGyu-Kim
787e247a08 feat(hooks): add auto-update-checker for plugin version management
Checks npm registry for latest version on session.created, invalidates
cache and shows toast notification when update is available.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 01:18:39 +09:00
YeonGyu-Kim
6f229a86e3 fix(background-task): change default block to false and clarify system notification
- Change background_output default from block=true to block=false
- Add documentation about system auto-notification on task completion
- Clarify that block=false returns full status info, not empty

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 01:18:19 +09:00
YeonGyu-Kim
5fd59afacf feat(antigravity): add thought signature support for multi-turn conversations
Gemini 3 Pro requires thoughtSignature on function call blocks in
subsequent requests. This commit:

- Add thought-signature-store for session-based signature storage
- Extract signature from both streaming (SSE) and non-streaming responses
- Inject signature into functionCall parts on subsequent requests
- Maintain consistent sessionId per fetch instance

Debug logging available via ANTIGRAVITY_DEBUG=1

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 01:16:53 +09:00
YeonGyu-Kim
3d273ff853 fix(hooks): use last assistant message tokens instead of cumulative sum
Previously, token calculation accumulated ALL assistant messages' tokens,
causing incorrect usage display (e.g., 524.9%) after compaction.
Now uses only the last message's input tokens, which reflects the actual
current context window usage.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 01:02:21 +09:00
YeonGyu-Kim
6a565ee126 refactor: remove opencode-openai-codex-auth dependency and auth subpath
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
0bf853d9ef feat(antigravity-auth): separate google-auth module with dynamic port allocation
- Separate Google Antigravity auth to 'oh-my-opencode/google-auth' subpath
- 'oh-my-opencode/auth' now exports OpenAI Codex auth plugin
- Implement dynamic port allocation to avoid port conflicts
- Add userAgent, requestId, sessionId fields for Antigravity API compatibility
- Add debug logging for troubleshooting (ANTIGRAVITY_DEBUG=1)

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
16393b2554 fix(antigravity-auth): apply auth headers in pass-through path
Pass-through path (non-string body) now preserves Authorization header.
This ensures authentication works even when request transformation is bypassed.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
d450c4f966 fix(antigravity-auth): address Oracle feedback - custom credentials, logging, docs
- Fix custom credentials to actually work in OAuth/refresh flows
  - oauth.ts: Add clientId/clientSecret parameters to buildAuthURL(), exchangeCode()
  - token.ts: Add clientId/clientSecret parameters to refreshAccessToken()
  - fetch.ts: Pass credentials to oauth/token functions
  - plugin.ts: Use closure cache for credentials, pass to all flows

- Unify console.* logging policy with ANTIGRAVITY_DEBUG guards
  - constants.ts: Document logging policy
  - tools.ts: Guard console.warn with ANTIGRAVITY_DEBUG
  - plugin.ts: Guard 4 console.error with ANTIGRAVITY_DEBUG

- Add explicit init.body type handling
  - fetch.ts: Check body type, pass-through non-string bodies
  - fetch.ts: Document body type assumption

- Document SSE buffering behavior
  - response.ts: Add warning that current implementation buffers
  - response.ts: Add TODO for future ReadableStream enhancement

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
4b3b581901 fix(background-task): handle SDK response structure compatibility
- Handle both SDK response patterns: .data wrapper vs direct array
- Add null/empty message checks for robustness
- Improve type safety with explicit interface definitions
- Prevent errors when messages array is undefined

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
7bfca25958 feat(google-antigravity-auth): create auth plugin for Google models
- Implement createGoogleAntigravityAuthPlugin factory function
- Add OAuth method with PKCE for Google authentication
- Create custom fetch interceptor loader for Antigravity API
- Update auth.ts to export Google Antigravity plugin as default
- Update barrel export in antigravity/index.ts
- Add Google Antigravity auth location to AGENTS.md

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
d444e62b20 feat(antigravity-auth): add request/response transformation with tools and thinking
🤖 GENERATED WITH ASSISTANCE OF OpenCode
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
07e2e907c5 feat(antigravity-auth): add OAuth flow and token management
🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
36b8576c78 feat(antigravity-auth): add types and constants foundation
🤖 Generated with assistance of OhMyOpenCode
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
5ba1d9f3c3 refactor(background-notification): remove chat.message handler
- Remove unused chat message notification handler
- Remove formatDuration and formatNotifications helpers
- Simplify to event-only handling
- Remove chat.message hook call from main plugin

Background task notifications now rely on event-based system only.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
efe37d4cfc refactor(auth): rename codex-auth to auth subpath export
- Rename src/codex-auth.ts → src/auth.ts
- Update package.json exports: ./codex-auth → ./auth
- Update build script to include auth.ts

Users can now use oh-my-opencode/auth as OpenAI auth plugin.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
c662f9c240 fix(session-recovery): handle empty content in user messages
Previously only checked assistant messages for empty content.
Now checks all messages except the final assistant message,
following Anthropic API rules.

Fixes: "messages.N: all messages must have non-empty content" error

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
12c0b7b6c0 refactor(omo-task): rename to call_omo_agent with run_in_background parameter
- Rename omo-task to call-omo-agent with mandatory run_in_background parameter
- Implement background mode using BackgroundManager (fire-and-forget abort)
- Implement sync mode with existing subagent logic
- Fix background_cancel: use fire-and-forget abort to prevent parent session interruption
- Add call_omo_agent to tool disable list in explore/librarian agents
- Add call_omo_agent to tool disable list in BackgroundManager

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
f007437991 feat(anthropic-auto-compact): add retry mechanism with exponential backoff
Implements retry logic with up to 5 attempts when compaction fails.
Uses exponential backoff strategy (2s → 4s → 8s → 16s → 30s).
Shows toast notifications for retry status and final failure.
Prevents infinite loops by clearing state after max attempts.

🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode
2025-12-13 00:35:34 +09:00
YeonGyu-Kim
f6bdc45fe7 feat(background-task): disable tools in child sessions
Background task tool이 child session을 생성할 때 background_task, background_output, background_cancel 도구를 자동으로 비활성화합니다. OpenCode Task tool 패턴과 동일하게 무한 재귀 호출을 방지합니다.

- manager.ts: promptAsync 호출 시 tools 설정 추가
- index.ts: 불필요한 agent 레벨 disable 설정 제거 (manager에서 처리)
- notification: tool calls 카운트 제거 (정확하게 트래킹되지 않음)

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2025-12-13 00:35:34 +09:00