Skip to content

ct filter fails: opencode run rejects --output-format json#500

Merged
MichielDean merged 9 commits into
mainfrom
feat/ci-3074d
May 10, 2026
Merged

ct filter fails: opencode run rejects --output-format json#500
MichielDean merged 9 commits into
mainfrom
feat/ci-3074d

Conversation

@MichielDean
Copy link
Copy Markdown
Owner

Closes droplet ci-3074d.

Summary

Fixes ct filter which fails because callFilterAgent() passes --output-format json to opencode's run subcommand, but opencode only recognizes --format as a flag on the run subcommand (not --output-format).

Changes

  • Add FormatArgs []string to NonInteractiveConfig for config-driven format flags
  • Update opencode builtin with FormatArgs: ['--format','json'] and ResumeFlag: '-s'
  • Remove hardcoded --output-format from callFilterAgent
  • Extend cloneSliceFields to deep-copy FormatArgs
  • Update fakeagent detection logic for both --format and --output-format
  • Fix pre-existing test failures (git config email/name)
  • Restore SHA-pinned GitHub Actions refs for supply chain security
  • Fix gofmt issues and stale comment references
  • All 13 test packages pass

Lobsterdog Contributors 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.
- 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
…urity

Revert mutable tag refs (@v6, @v4, @v7) back to SHA-pinned refs with
version comments in pr.yml and release.yml. Tag refs are vulnerable to
supply chain attacks via tag repointing. Also fix fakeagent doc comment
to accurately describe interactive mode trigger condition.
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.
@MichielDean MichielDean merged commit 900e275 into main May 10, 2026
2 of 3 checks passed
@MichielDean MichielDean deleted the feat/ci-3074d branch May 10, 2026 03:30
MichielDean pushed a commit that referenced this pull request May 11, 2026
Codifies the env var pollution root cause and fixes that were discovered
through the PR #500#502 → direct-exec arc. Includes:
- Session not found: OPENCODE_SERVER_* env var pollution
- Empty response: missing --dangerously-skip-permissions or invalid model
- Timeout: CT_FILTER_TIMEOUT env var
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