Skip to content

feat: add configuration persistence for model selections#4

Merged
adamdotdevin merged 1 commit intoanomalyco:devfrom
rekram1-node:feat-persist-model-selection
May 14, 2025
Merged

feat: add configuration persistence for model selections#4
adamdotdevin merged 1 commit intoanomalyco:devfrom
rekram1-node:feat-persist-model-selection

Conversation

@rekram1-node
Copy link
Copy Markdown
Collaborator

Fixes #3

I originally brought this up when I added model selection in the first place, I have these changes in open pr and figured I would copy it over to here since it is the new repo.

@adamdotdevin adamdotdevin merged commit 797045e into anomalyco:dev May 14, 2025
@adamdotdevin
Copy link
Copy Markdown
Member

love it, thanks!

burgercrisis added a commit to burgercrisis/opencode that referenced this pull request Jan 8, 2026
…d dank

Windows Command Execution Fixes:
- Add detectCommandShell() and parseCommand() functions for shell detection
- Implement direct PowerShell execution bypassing cmd.exe wrapper
- Add shell built-ins detection and needsShellExecution function
- Fix stream draining to prevent race conditions (Promise.all)
- Remove duplicate abort listeners

Edit Tool Improvements:
- Add newString validation guard (handles undefined/null/empty)
- Add UnicodeNormalizedReplacer for smart quotes and em-dashes
- Fix multi-line pattern matching with empty lines (Issue anomalyco#26)
- Add unique match identification for replaceFirst functionality
- Improve block anchor matching with variable gap handling

Documentation:
- Add verified-fixes-summary.md documenting all fixed issues
- Add windows-command-execution-issues.md comprehensive analysis
- Add linux-unix-mac-compatibility-analysis.md for cross-platform impact

Fixes: Issues anomalyco#2, anomalyco#3, anomalyco#4, anomalyco#5, anomalyco#7, anomalyco#8, anomalyco#9, anomalyco#15, anomalyco#19, anomalyco#26
randomm referenced this pull request in randomm/opencode Jan 9, 2026
… (#4)

* feat: implement Remory MCP integration (#3)

- Add comprehensive TDD test suite for configuration validation
- Update opencode.json to use Remory via Docker exec command
- Add infrastructure tests for container health and connectivity
- Include placeholder tests for memory operations and semantic search

Following GitHub issue #3 requirements for enhanced memory capabilities.

* test: enhance Remory integration test coverage (#3)

- Add comprehensive test suite for Remory MCP integration
- Validate Docker container health and connectivity
- Test semantic search capabilities and performance
- Verify memory tool compatibility with Remory backend
- 100% test coverage for configuration validation
- All tests passing with 7/7 success rate

* docs: add comprehensive Remory memory service documentation (#3)

- Document enhanced memory capabilities with semantic search
- Add Docker container setup instructions
- Detail 5-15x performance improvements over basic memory server
- Include technical architecture and configuration examples
- Document memory operations and performance benefits
- Complete documentation requirements for issue #3

* docs: verify MCP configuration for local Remory instance

The MCP memory configuration in opencode.json is already correctly set up to use the local Remory instance running in Docker. No changes needed.
adolago referenced this pull request in adolago/zee Jan 10, 2026
Merged Snyk PRs:
- PR #9: node 25.2.1-bullseye-slim → 25.2.1-trixie-slim
- PR #4: node 20-slim → 20.19.6-trixie-slim
- PR #3: node 20 → 20.19.6-trixie-slim

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
kryptobaseddev added a commit to kryptobaseddev/opencode that referenced this pull request Feb 22, 2026
… leaks

Addresses the 4 remaining high-priority memory leak issues from the
work plan (I-9385-A, I-7046-A, PR-14635, I-7046-C partial).

I-9385-A (CRITICAL, Priority anomalyco#1) — tool/task.ts: call Session.remove()
after extracting subagent task output. This fires the session.deleted
event, which triggers cleanupSessionCaches() in the event-reducer —
freeing all in-memory messages, parts, diffs, permissions, and status
for the subagent session. The task_id in the output becomes a dead
reference; if the LLM tries to resume, Session.get() fails gracefully
and a fresh session is created. Validated: the cleanup infrastructure
already existed but was never invoked for subagent sessions.

I-7046-A (CRITICAL, Priority anomalyco#3) — session/compaction.ts: clear
part.state.output and part.state.attachments when pruning compacted
tool parts. Previously, prune() set time.compacted but left the full
output string in both the DB row and the in-memory store.
toModelMessages already substituted "[Old tool result content cleared]"
for compacted parts — this change aligns stored data with that
behavior, freeing the large strings from memory and disk.

PR-14635 (HIGH, Priority anomalyco#4) — TUI event listener cleanup:
- app.tsx: save the unsubscribe functions returned by all 6
  sdk.event.on() calls; call them in a single onCleanup() handler.
  Previously, onCleanup was not even imported.
- routes/session/index.tsx: save and clean up the message.part.updated
  listener. This component mounts/unmounts during session navigation,
  so each navigation previously added a duplicate listener.
- component/prompt/index.tsx: save and clean up the PromptAppend
  listener. Same mount/unmount pattern as the session component.

I-7046-C (partial) — the TUI event listener fixes above cover the
most impactful instances of the missing-dispose pattern. A full audit
of all subscribe() call sites remains as follow-up work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
praxstack referenced this pull request in praxstack/opencode Feb 25, 2026
…r details

- retry.ts: respect isRetryable:false and 4xx status in JSON error bodies (Issue #7)
- provider.ts: cap Bedrock Anthropic models at 200K context (Issue #4)
- batch.ts: include per-tool error details in failure output (Issue #9)
- retry.test.ts: 5 new tests for catch-all retry classification
tamarazuk added a commit to tamarazuk/opencode that referenced this pull request Mar 3, 2026
…odies

- Refresh VCS state before idempotency check in create() to avoid TOCTOU race (anomalyco#4, anomalyco#12)
- Use refreshed branch/defaultBranch in fallback PR return (anomalyco#9)
- Validate base branch exists before attempting gh pr create (anomalyco#22)
- Wrap review comment bodies in fenced blocks for structural separation (anomalyco#8)
sjawhar added a commit to sjawhar/opencode that referenced this pull request Mar 8, 2026
- Finding #1: re-sync active sessions after disposal by saving fullSyncedSessions
  before clear and calling result.session.sync() after successful bootstrap
- Finding anomalyco#2: cap retries at 5 with exponential backoff (2s/4s/8s/16s/30s) and
  generation counter to cancel stale retries when newer disposal arrives
- Finding anomalyco#3: move Instance.provide() inside while loop so each event stream
  reconnect iteration gets fresh context
- Finding anomalyco#4: remove unconditional startEventStream(process.cwd()); add events RPC
  method; thread calls it only when not in external transport mode
- Finding anomalyco#5: replace manual new Promise+setTimeout with sleep() from node:timers/promises
- Finding anomalyco#6: reload() aborts current event stream and conditionally restarts it
sjawhar added a commit to sjawhar/opencode that referenced this pull request Mar 8, 2026
- Finding #1: re-sync active sessions after disposal by saving fullSyncedSessions
  before clear and calling result.session.sync() after successful bootstrap
- Finding anomalyco#2: cap retries at 5 with exponential backoff (2s/4s/8s/16s/30s) and
  generation counter to cancel stale retries when newer disposal arrives
- Finding anomalyco#3: move Instance.provide() inside while loop so each event stream
  reconnect iteration gets fresh context
- Finding anomalyco#4: remove unconditional startEventStream(process.cwd()); add events RPC
  method; thread calls it only when not in external transport mode
- Finding anomalyco#5: replace manual new Promise+setTimeout with sleep() from node:timers/promises
- Finding anomalyco#6: reload() aborts current event stream and conditionally restarts it
sjawhar added a commit to sjawhar/opencode that referenced this pull request Mar 8, 2026
- Finding #1: re-sync active sessions after disposal by saving fullSyncedSessions
  before clear and calling result.session.sync() after successful bootstrap
- Finding anomalyco#2: cap retries at 5 with exponential backoff (2s/4s/8s/16s/30s) and
  generation counter to cancel stale retries when newer disposal arrives
- Finding anomalyco#3: move Instance.provide() inside while loop so each event stream
  reconnect iteration gets fresh context
- Finding anomalyco#4: remove unconditional startEventStream(process.cwd()); add events RPC
  method; thread calls it only when not in external transport mode
- Finding anomalyco#5: replace manual new Promise+setTimeout with sleep() from node:timers/promises
- Finding anomalyco#6: reload() aborts current event stream and conditionally restarts it
tamarazuk added a commit to tamarazuk/opencode that referenced this pull request Mar 21, 2026
…odies

- Refresh VCS state before idempotency check in create() to avoid TOCTOU race (anomalyco#4, anomalyco#12)
- Use refreshed branch/defaultBranch in fallback PR return (anomalyco#9)
- Validate base branch exists before attempting gh pr create (anomalyco#22)
- Wrap review comment bodies in fenced blocks for structural separation (anomalyco#8)
ESRE-dev added a commit to ESRE-dev/opencode that referenced this pull request Mar 27, 2026
    * Restructure watchdogTick so idle-detection sweeps
      SessionActivity.list() independently of stuck-tool
      query results — fixes Bug anomalyco#4 (idle gated behind
      stuck-tool results) and Bug anomalyco#5 (leaf.length === 0
      early return skipping idle detection entirely)
    * Add pre-cancel map cleanup in the idle sweep to
      prevent unbounded growth of stale entries
    * Define CancelRequested bus event in processor and
      publish from abortChildren so child sessions get
      in-memory cancel alongside the DB updates (Bug anomalyco#7)
    * Add SessionPrompt.init() subscribing to the event,
      called from bootstrap alongside SessionActivity
    * Wrap AI SDK iterator consumption in try/finally to
      call iter.return() on abort, preventing leaked HTTP
      connections (Bug anomalyco#8)
    * Check abort signal before retry continue to stop
      cancelled sessions from restarting loops (Bug anomalyco#9)
    * Remove shadowed abort promise in permission-check
      loop so pre-aborted signals reject immediately
      instead of hanging (Bug anomalyco#10)
    * Update watchdog tests for independent idle sweep
      and add cancel-propagation event tests
ESRE-dev added a commit to ESRE-dev/opencode that referenced this pull request Mar 27, 2026
    * Restructure watchdogTick so idle-detection sweeps
      SessionActivity.list() independently of stuck-tool
      query results — fixes Bug anomalyco#4 (idle gated behind
      stuck-tool results) and Bug anomalyco#5 (leaf.length === 0
      early return skipping idle detection entirely)
    * Add pre-cancel map cleanup in the idle sweep to
      prevent unbounded growth of stale entries
    * Define CancelRequested bus event in processor and
      publish from abortChildren so child sessions get
      in-memory cancel alongside the DB updates (Bug anomalyco#7)
    * Add SessionPrompt.init() subscribing to the event,
      called from bootstrap alongside SessionActivity
    * Wrap AI SDK iterator consumption in try/finally to
      call iter.return() on abort, preventing leaked HTTP
      connections (Bug anomalyco#8)
    * Check abort signal before retry continue to stop
      cancelled sessions from restarting loops (Bug anomalyco#9)
    * Remove shadowed abort promise in permission-check
      loop so pre-aborted signals reject immediately
      instead of hanging (Bug anomalyco#10)
    * Update watchdog tests for independent idle sweep
      and add cancel-propagation event tests
andreipromarketing-dev pushed a commit to andreipromarketing-dev/opencode that referenced this pull request Apr 7, 2026
…t-errors-another-one

Fix markdownlint errors (MD038, MD058, MD025, MD034)
andreipromarketing-dev pushed a commit to andreipromarketing-dev/opencode that referenced this pull request Apr 7, 2026
* feat: add pending instinct TTL pruning and /prune command

Pending instincts generated by the observer accumulate indefinitely
with no cleanup mechanism. This adds lifecycle management:

- `instinct-cli.py prune` — delete pending instincts older than 30 days
  (configurable via --max-age). Supports --dry-run and --quiet flags.
- Enhanced `status` command — shows pending count, warns at 5+,
  highlights instincts expiring within 7 days.
- `observer-loop.sh` — runs prune before each analysis cycle.
- `/prune` slash command — user-facing command for manual pruning.

Design rationale: council consensus (4/4) rejected auto-promote in
favor of TTL-based garbage collection. Frequency of observation does
not establish correctness. Unreviewed pending instincts auto-delete
after 30 days; if the pattern is real, the observer will regenerate it.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* fix: remove duplicate functions, broaden extension filter, fix prune output

- Remove duplicate _collect_pending_dirs and _parse_created_date defs
- Use ALLOWED_INSTINCT_EXTENSIONS (.md/.yaml/.yml) instead of .md-only
- Track actually-deleted items separately from expired for accurate output
- Update README.md and AGENTS.md command counts: 59 → 60

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* fix: address Copilot and CodeRabbit review findings

- Use is_dir() instead of exists() for pending path checks
- Change > to >= for --max-age boundary (--max-age 0 now prunes all)
- Use CLV2_PYTHON_CMD env var in observer-loop.sh prune call
- Remove unused source_dupes variable
- Remove extraneous f-string prefix on static string

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* fix: update AGENTS.md project structure command count 59 → 60

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: address cubic and coderabbit review findings

- Fix status early return skipping pending instinct warnings (cubic anomalyco#1)
- Exclude already-expired items from expiring-soon filter (cubic anomalyco#2)
- Warn on unparseable pending instinct age instead of silent skip (cubic anomalyco#4)
- Log prune failures to observer.log instead of silencing (cubic anomalyco#5)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: YAML single-quote unescaping, f-string cleanup, add /prune to README

- Fix single-quoted YAML unescaping: use '' doubling (YAML spec) not
  backslash escaping which only applies to double-quoted strings (greptile P1)
- Remove extraneous f-string prefix on static string (coderabbit)
- Add /prune to README command catalog and file tree (cubic)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
guazi04 pushed a commit to guazi04/opencode that referenced this pull request Apr 8, 2026
fix: 压缩核心工具描述(bash/todowrite/task),每条消息节省 ~4k tokens

Closes anomalyco#4

See merge request iself-team/opencode!8
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.

feat: model config persistence

2 participants