ct filter fails: opencode run rejects --output-format json#500
Merged
Conversation
added 9 commits
May 9, 2026 19:22
…Args Replace hardcoded --output-format json in callFilterAgent with preset.NonInteractive.FormatArgs ([]string). The opencode builtin now correctly uses --format json (opencode's actual flag) instead of the unrecognized --output-format. Also set ResumeFlag to -s for opencode sessions. Changes: - Add FormatArgs []string to NonInteractiveConfig - Set opencode builtin: FormatArgs=[--format json], ResumeFlag=-s - Remove hardcoded --output-format json from callFilterAgent - Extend cloneSliceFields to deep-copy NonInteractive.FormatArgs - Update fakeagent to detect --format in addition to --output-format - Update all test presets with FormatArgs - Add tests for FormatArgs placement, omission, and resume interaction - Add tests for opencode FormatArgs and ResumeFlag builtins - Add FormatArgs isolation test in Builtins_ReturnsCopy
Fix stray tab after var keyword in builtins declaration and alignment whitespace in ResumeFlag field.
…_test.go" This reverts commit 812210d.
- Fix git config email/name in test helpers to use noreply@lobsterdog.dev and 'Lobsterdog Contributors' to comply with the global pre-commit hook - Apply gofmt to preset.go (tab+space -> tab) and filter_test.go (spacing) - Affected files: sandbox_test.go, runner_test.go, context_test.go, scheduler_test.go, drought_hooks_test.go, preset.go, filter_test.go
The FormatArgs change replaced the hardcoded --output-format flag passed to agents with configurable FormatArgs (now --format json for opencode). Several code comments still referenced --output-format in the context of agent invocation rather than the ct filter user-facing CLI flag. Updated: - filter.go: fallback comment now says 'agent may not produce parseable JSON' instead of 'may not support --output-format json'; printFilterResult doc clarifies --output-format is the user-facing ct filter flag - filter_test.go: test comments reference FormatArgs (--format json) instead of --output-format json; raw_fallback comment describes behavior accurately - fakeagent/main.go: hardcodedJSONEnvelope doc mentions both --format and --output-format
The bare repo created by makeBareAndClone had HEAD pointing to refs/heads/master (git init --bare default). When cloning from this bare repo on GitHub-hosted runners (git 2.53+), the local 'main' branch is not correctly set up. Adding 'git symbolic-ref HEAD refs/heads/main' after pushing ensures clones default to main.
…imeout The upgrade test was failing because systemctl restart after the fresh-install test didn't reliably bring the service back to active within 10s. Fix by explicitly stopping the service before starting it (instead of restart), and increase the upgrade test timeout from 10s to 20s to accommodate the stop+start sequence.
…start Adds verbose error messages to the test_upgrade function in run-installer-tests.sh so CI reveals which step fails. Also dumps systemd service status and journal on service-active timeout.
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.
Closes droplet ci-3074d.
Summary
Fixes
ct filterwhich fails becausecallFilterAgent()passes--output-format jsonto opencode'srunsubcommand, but opencode only recognizes--formatas a flag on therunsubcommand (not--output-format).Changes
FormatArgs []stringtoNonInteractiveConfigfor config-driven format flagsFormatArgs: ['--format','json']andResumeFlag: '-s'--output-formatfromcallFilterAgentcloneSliceFieldsto deep-copyFormatArgs--formatand--output-format