Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Plugin Options Configurability
summary: AdaptiveThinkingPlugin now supports configurable enabled/quiet flags, service and tool naming, custom tool descriptions and system prompts, with invalid config logging and disabled-plugin no-op behavior.
summary: Plugin options now support enabled, quiet, toolName, toolDescription, and systemPrompt; serviceName is removed from public config and defaults remain functional.
tags: []
related: [facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_confirmation.md]
related: [facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_confirmation.md, project_management/pull_requests/pr_6_replacement_for_default_options_changes.md]
keywords: []
createdAt: '2026-04-25T12:40:26.166Z'
updatedAt: '2026-04-25T12:49:59.689Z'
updatedAt: '2026-04-25T17:44:35.947Z'
---
## Reason
Document configurable plugin options and validation behavior for the adaptive thinking plugin
Capture the plugin configuration surface and defaults.

## Raw Concept
**Task:**
Document the configurable plugin options added to AdaptiveThinkingPlugin.
Document plugin configuration support and default behavior

**Changes:**
- Identified that the current plugin behavior is hard-coded in src/index.ts
Expand All @@ -27,6 +27,9 @@ Document the configurable plugin options added to AdaptiveThinkingPlugin.
- Added tests for config behavior
- Updated README with config docs and example
- Added a minor changeset
- Added plugin config support for enabled, quiet, toolName, toolDescription, and systemPrompt
- Removed serviceName from public config
- Kept internal log service fixed as opencode-adaptive-thinking

**Files:**
- src/index.ts
Expand All @@ -37,21 +40,21 @@ Document the configurable plugin options added to AdaptiveThinkingPlugin.
- .changeset/configurable-plugin-options.md

**Flow:**
load config -> validate with Zod -> if invalid log and toast -> if disabled return {} -> otherwise expose configured tool and guidance
plugin loads config -> validates with Zod -> applies defaults -> runs with optional overrides

**Timestamp:** 2026-04-25

**Author:** Ian
**Author:** assistant

## Narrative
### Structure
The implementation centralizes plugin configuration in src/config.ts and threads the validated options into AdaptiveThinkingPlugin so runtime behavior and exposed tool metadata can be customized.
Configuration is defined in src/config.ts, consumed by src/index.ts, and documented in README.md. Tests cover disabled plugin behavior, invalid config handling, custom tool metadata, custom system prompt, and default-options regression.

### Dependencies
Depends on the existing opencode-byterover config pattern, Zod validation, and the plugin runtime that shows toasts and logs errors on invalid configuration.
Uses Zod for schema validation and relies on high-signal tests to protect the public config surface.

### Highlights
Tests, typecheck, lint, format check, and build all passed after the implementation. Validation only found formatting drift in src/index.test.ts before formatting was applied.
The config surface is intentionally kept small and does not expose serviceName. Default behavior is treated as a regression requirement.

### Rules
Curate only information with lasting value: facts, decisions, technical details, preferences, or notable outcomes.
Expand All @@ -60,8 +63,7 @@ Curate only information with lasting value: facts, decisions, technical details,
Example options include enabled, quiet, serviceName, toolName, toolDescription, and systemPrompt.

## Facts
- **config_pattern**: The plugin uses the opencode-byterover config pattern. [project]
- **plugin_options**: Supported options are enabled, quiet, serviceName, toolName, toolDescription, and systemPrompt. [project]
- **invalid_config_behavior**: Invalid config logs an error, shows a toast, and returns {}. [project]
- **disabled_plugin_behavior**: Disabled plugin returns {}. [project]
- **tool_name_behavior**: Custom toolName updates both the exposed tool and the system prompt guidance. [project]
- **plugin_options**: The plugin supports configurable enabled, quiet, toolName, toolDescription, and systemPrompt options. [project]
- **service_name_config**: serviceName was removed from the public config surface. [project]
- **internal_log_service_name**: The internal log service name remains opencode-adaptive-thinking. [project]
- **default_options_behavior**: Default plugin behavior must continue working when no options are provided. [project]
8 changes: 4 additions & 4 deletions .brv/context-tree/facts/preference/reasoning_effort.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort
createdAt: '2026-04-25T10:20:14.913Z'
keywords: []
related: [facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md]
summary: Reasoning effort preference is set to low.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T10:20:14.913Z'
title: Reasoning Effort
updatedAt: '2026-04-25T11:55:01.662Z'
---
## Reason
Expand Down
48 changes: 48 additions & 0 deletions .brv/context-tree/facts/project/bounded_session_state_lru_cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
createdAt: '2026-04-25T17:44:36.487Z'
keywords: []
related: [project_management/pull_requests/pr_6_replacement_for_default_options_changes.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_behavior.md]
summary: Per-session adaptive-thinking state was replaced with a bounded LRU cache capped at 500 sessions, with regression coverage for eviction and type narrowing fixes.
tags: []
title: Bounded Session State LRU Cache
updatedAt: '2026-04-25T17:44:36.487Z'
---
## Reason
Capture the bounded per-session state change and its test coverage.

## Raw Concept
**Task:**
Document bounded session state behavior and related regression coverage

**Changes:**
- Replaced module-level Maps with bounded LRU-backed session state
- Added eviction regression test
- Fixed a typecheck issue by narrowing resolvedVariant before assignment

**Files:**
- src/index.ts
- src/index.test.ts

**Flow:**
session interaction -> resolve variant state -> store in LRU -> evict oldest entry when cap exceeded

**Timestamp:** 2026-04-25

**Author:** assistant

## Narrative
### Structure
The plugin previously kept state in three module-level Maps; it now uses a single bounded LRU cache to prevent growth in long-running processes.

### Dependencies
Requires regression tests to preserve default behavior and eviction semantics while keeping the implementation type-safe.

### Highlights
The cache is capped at 500 sessions and protects the process from unbounded memory growth.

## Facts
- **session_state_storage**: Per-session state was replaced with a bounded LRU cache. [project]
- **session_state_lru_cap**: The LRU cache cap is 500 sessions. [project]
- **old_session_state_maps**: The old unbounded state used three module-level Maps: currentVariant, persistedVariant, and temporaryResetVariant. [project]
- **lru_eviction_regression_test**: A regression test verifies that the oldest session state is evicted after cache pressure. [project]
- **typecheck_fix**: A typecheck issue was fixed by narrowing resolvedVariant before assignment. [project]
8 changes: 4 additions & 4 deletions .brv/context-tree/facts/project/git_branch_checkout_safety.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Git branch checkout safety
createdAt: '2026-04-25T12:25:59.254Z'
keywords: []
related: [facts/project/git_stash_reapply_outcome.md]
summary: Use Git refusal as a safety signal; stash conflicting local .brv changes with a clear label before switching branches and pulling updates.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T12:25:59.254Z'
title: Git branch checkout safety
updatedAt: '2026-04-25T12:25:59.254Z'
---
## Reason
Expand Down
8 changes: 4 additions & 4 deletions .brv/context-tree/facts/project/git_stash_reapply_outcome.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Git Stash Reapply Outcome
createdAt: '2026-04-25T12:27:24.819Z'
keywords: []
related: [facts/project/git_branch_checkout_safety.md]
summary: Reapplying stash on main restored .brv context-tree changes without dropping the stash; reasoning-effort state handling and medium handling files were restored, while git branch checkout safety file remained present.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T12:27:24.819Z'
title: Git Stash Reapply Outcome
updatedAt: '2026-04-25T12:27:24.819Z'
---
## Reason
Expand Down
8 changes: 4 additions & 4 deletions .brv/context-tree/facts/project/pr_push_outcome.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: PR Push Outcome
createdAt: '2026-04-25T13:12:20.630Z'
keywords: []
related: [facts/project/reasoning_effort_medium_handling.md]
summary: The remaining .brv memory was committed as 7edf357 and pushed; the PR branch is clean and up to date with origin/feat/configurable-plugin-options.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T13:12:20.630Z'
title: PR Push Outcome
updatedAt: '2026-04-25T13:12:20.630Z'
---
## Reason
Expand Down
46 changes: 31 additions & 15 deletions .brv/context-tree/facts/project/reasoning_effort_behavior.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Reasoning Effort Behavior
summary: Temporary low reasoning effort can be set in a live session, invalid levels are rejected, and the next idle transition should reset to medium once.
summary: Reasoning effort behavior now honors quiet invalid-config handling, ignores stale cached variants for the current model, and resolves the newest relevant agent; README and tests were updated and the suite passed.
tags: []
related: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md, facts/project/bounded_session_state_lru_cache.md, project_management/pull_requests/context.md]
keywords: []
createdAt: '2026-04-25T11:53:01.433Z'
updatedAt: '2026-04-25T11:54:28.539Z'
updatedAt: '2026-04-26T10:57:08.718Z'
---
## Reason
Persist lasting knowledge about reasoning effort behavior, validation, and checks
Capture durable implementation and verification details from the conversation

## Raw Concept
**Task:**
Document reasoning effort session behavior and verification outcomes
Document the reasoning effort behavior changes and verification outcomes

**Changes:**
- Split state into currentVariant, persistedVariant, and temporaryResetVariant
Expand All @@ -27,36 +27,52 @@ Document reasoning effort session behavior and verification outcomes
- Confirmed invalid reasoning effort level is rejected before mutation
- Observed expected one-time idle reset behavior to medium
- Verified tests, typecheck, lint, format:check, and build passed
- Identified quiet mode bug where invalid config still shows a toast.
- Noted build bundling is large and should externalize runtime dependencies.
- Observed cached variants should be validated against current model variants.
- Flagged fallback agent resolution overwriting agentName when scanning messages backward.
- Highlighted inconsistent error serialization across code paths.
- Outlined missing edge-case tests and README usability gaps.
- Considered configurable reset behavior for temporary effort handling.
- Called out module-level singleton state as a potential multi-instance risk.
- Honors quiet: true for invalid config
- Ignores stale cached reasoning effort for the current model
- Resolves fallback agent using the newest relevant agent
- Expanded regression tests and README documentation

**Files:**
- src/index.ts
- src/index.test.ts
- README.md

**Flow:**
set reasoning effort -> validate level -> run checks -> idle transition resets to medium once
add regression tests -> confirm failures -> apply minimal fixes -> expand README -> run verification suite

**Timestamp:** 2026-04-25T11:54:23.547Z
**Timestamp:** 2026-04-26T10:57:02.697Z

**Author:** assistant

## Narrative
### Structure
This entry records a live-session reasoning-effort state change and the expected follow-up idle reset behavior.
The update spans production logic in src/index.ts, coverage in src/index.test.ts, and user-facing documentation in README.md.

### Dependencies
The behavior depends on the session state machine and validation for allowed reasoning effort levels.
The behavior depends on current model validity, cached reasoning state, and agent resolution order.

### Highlights
A temporary low setting was accepted, an invalid level was rejected, and the next idle transition should restore medium only once.
The work completed successfully after tests turned green, and the verification suite passed in full.

### Rules
Temporary reasoning effort now resets only once on session.idle. Reset prompts are ignored and should not remain visible in-context. Invalid levels are rejected before calling promptAsync or mutating state.

### Examples
Checks that passed included pnpm run test, pnpm run typecheck, pnpm run lint, pnpm run format:check, and pnpm run build.
Examples mentioned include quiet invalid-config handling, stale cache invalidation, and newest-agent fallback resolution.

## Facts
- **reasoning_effort**: Reasoning effort was set to low in a live session. [project]
- **reasoning_effort_validation**: Invalid reasoning effort levels are rejected before mutation. [project]
- **reasoning_effort_reset_behavior**: The temporary low reasoning effort should reset to medium once on idle, then stop repeating. [project]
- **verification_status**: Automated checks passed: test, typecheck, lint, format:check, and build. [project]
- **reasoning_effort**: Reasoning effort was set to high [project]
- **quiet_invalid_config_behavior**: The implementation now honors quiet: true for invalid config to suppress toast while still logging [project]
- **stale_cached_variants**: Cached reasoning effort is ignored when it is invalid for the current model [project]
- **agent_fallback_resolution**: Fallback agent resolution uses the newest relevant agent [project]
- **test_coverage**: Regression tests were added for quiet config errors, stale cached variants, newest-agent fallback, provider lookup failure, and reset failure recovery [project]
- **verification_suite**: The project verification suite passed: format:check, lint, typecheck, test, and build [project]
- **test_results**: The test suite reported 15 passed [project]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort Confirmation
createdAt: '2026-04-25T11:06:39.753Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md]
summary: The only visible confirmation after the tool call was "Reasoning effort set to low".
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:06:39.753Z'
title: Reasoning Effort Confirmation
updatedAt: '2026-04-25T11:08:43.379Z'
---
## Reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort Medium Handling
createdAt: '2026-04-25T11:56:05.207Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/pr_push_outcome.md]
summary: Reasoning effort was set to medium, a patch changeset was added for opencode-adaptive-thinking, and formatting, lint, test, and typecheck all passed before committing and pushing only the changeset.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:56:05.207Z'
title: Reasoning Effort Medium Handling
updatedAt: '2026-04-25T12:17:35.362Z'
---
## Reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort Reset Behavior
createdAt: '2026-04-25T11:09:11.082Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md]
summary: Reasoning effort can be reset to medium, and the reset notice states that it has been reset to medium.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:09:11.082Z'
title: Reasoning Effort Reset Behavior
updatedAt: '2026-04-25T11:54:47.414Z'
---
## Reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort Reset Message
createdAt: '2026-04-25T11:08:33.219Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md]
summary: Reasoning effort was reset to medium, with no separate tool-generated reset confirmation observed beyond an earlier low setting message.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:08:33.219Z'
title: Reasoning Effort Reset Message
updatedAt: '2026-04-25T11:11:38.940Z'
---
## Reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort Reset Notice
createdAt: '2026-04-25T11:44:48.223Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md]
summary: Reasoning effort reset notice is visible and states that reasoning effort reset to medium.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:44:48.223Z'
title: Reasoning Effort Reset Notice
updatedAt: '2026-04-25T11:44:48.223Z'
---
## Reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort Reset Notice Visibility
createdAt: '2026-04-25T11:12:05.181Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_state_handling.md, facts/project/reasoning_effort_medium_handling.md]
summary: The reset notice is visible as a user-level message rather than a separate tool confirmation.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:12:05.181Z'
title: Reasoning Effort Reset Notice Visibility
updatedAt: '2026-04-25T11:12:05.181Z'
---
## Reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Reasoning Effort State Handling
createdAt: '2026-04-25T11:48:50.291Z'
keywords: []
related: [facts/preference/reasoning_effort.md, facts/project/reasoning_effort_confirmation.md, facts/project/reasoning_effort_reset_message.md, facts/project/reasoning_effort_reset_notice.md, facts/project/reasoning_effort_reset_notice_visibility.md, facts/project/reasoning_effort_reset_behavior.md, facts/project/reasoning_effort_behavior.md, facts/project/reasoning_effort_medium_handling.md, facts/project/bounded_session_state_lru_cache.md]
summary: SDK types were restored in src/index.ts, the PR title was changed to conventional commit style, and verification passed.
tags: []
related: []
keywords: []
createdAt: '2026-04-25T11:48:50.291Z'
title: Reasoning Effort State Handling
updatedAt: '2026-04-25T12:13:21.426Z'
---
## Reason
Expand Down
Loading
Loading