Every so often, at least once per day, the agent/model starts returning weird stuff.
Description
Hi, This is something weird, but since it happened three times already, I want to report it in case it's relevant. Feels to me like the agent or the model might be injected with some weird code/repo, and is causing the output or reasoning to become giberish.
OpenCode version
1.0.153
Steps to reproduce
I don't think there's an specific flow. What I noticed is that this happens to Copilot Model.
Screenshot and/or share link
Operating System
MACOS 26.2
Terminal
Warp Terminal
This issue might be a duplicate of existing issues. Please check:
- #4990: Output from agent is frequently hidden - similar symptoms of unexpected agent output behavior
- #3241: Opencode stuck in Plan mode - agent behaving unexpectedly with output issues
- #2512: Opencode stuck in "generating" - agent unresponsiveness and garbled behavior
- #4943: github copilot: gpt-5-mini not supported via responses api - Copilot model-related issues
Feel free to ignore if none of these address your specific case.
what the
is there anything in your repo or AGENTS.md files that could trigger this? Never seen b4
The agents.MD is there:
at AGENTS.md
# Repository Guidelines
## Project Structure & Module Organization
Core services live in dedicated directories: `NI-MWAPI/` (Rails API), `NI-CMS/` (Laravel CMS), `NI-WebsiteFrontend/` (Next.js web), `NI-CMS-FE/` (Next.js admin), `frameflow-reader/` (React reader), `signer/` (Vue auth), and `NI-klecks/` (TypeScript art tool). Shared infrastructure lives in `NI-Infrastructure/`, database assets in `database/` and `supabase/`, and automation scripts in `scripts/`. Documentation and architecture references are under `docs/`. Keep service-specific assets and tests inside each service directory (`spec/`, `tests/`, or `__tests__/` as appropriate).
## Build, Test, and Development Commands
Run `./scripts/setup.sh` once to bootstrap local dependencies. Use `./scripts/dev/docker-start.sh` to start the full stack and `./scripts/dev/docker-stop.sh` to shut it down. For targeted work, `docker-compose -f ni-docker-compose.yml up -d ni-mwapi ni-cms` brings up API and CMS only. Tail logs with `docker-compose -f ni-docker-compose.yml logs -f <service>`. Rails console access: `docker exec -it ni-mwapi rails console`.
## Coding Style & Naming Conventions
Follow language defaults: 2-space indent for Ruby, PSR-12 for PHP, and 2-space indent with semicolons omitted for TypeScript/JavaScript. Rails code should pass `docker exec ni-mwapi bundle exec rubocop`; Laravel code should pass `docker exec ni-cms ./vendor/bin/pint`; front-end projects must satisfy `npm run lint` and `npm run format` where available. Use PascalCase for React/Vue components, camelCase for variables, and snake_case for database columns and Rails models (`SeriesIssue` => `series_issues`).
## Testing Guidelines
Rails specs run via `docker exec ni-mwapi bundle exec rspec`; enable coverage with `COVERAGE=true` for pipeline parity. Laravel tests run with `docker exec ni-cms php artisan test`. Front-end suites rely on Vitest or Jest; run `npm test` inside `frameflow-reader/`, `signer/`, or `NI-WebsiteFrontend/`. Name tests `_spec.rb`, `*Test.php`, or `*.test.ts[x]` to match existing suites. Commit only when all relevant tests pass locally.
## Commit & Pull Request Guidelines
Git history favors concise, imperative subjects (`chore: update docker-compose configuration`). Use Conventional Commit prefixes (`feat`, `fix`, `chore`, `docs`, `refactor`, `test`) plus an optional scope. Reference issue IDs where applicable (`feat(auth): add magic link expiry check`). PRs must include: summary of changes, impacted services, local test evidence, env variables touched, and screenshots for UI updates. Link to relevant docs in `docs/` when adding or altering architecture.
## Environment & Security Notes
Copy `.env.ni-docker` to `.env.ni-docker.local` and keep secrets out of version control. Stripe, Supabase, and Customer.io keys are required for end-to-end flows; use sandbox credentials only. Never commit real production keys or database dumps—store them in the secrets manager referenced in `NI-Infrastructure/`.
This one has a good clue @rekram1-node as the agent itself notices that the response is gibberished and apoligizes, lmk what can I provide.
Edit: Looks like this happens during the automcompacts!
what is that http:www.coutesy and link:... stuff? Is that the output of some tool?
That's what opencode outputs when performing the compacting process. I just starts showing this random outputs. And that's not on my files anywhere. If I quit the agent with ctrl+c, when I get back to the session all those outputs are nowhere to be found in the history.
This is so weird. Anyway you can do: opencode export > session.json for me?
This is only the relevant message, the previous one and the next one after this one are my user messages:
https://gist.github.com/tebayoso/4210322e381229ae96291ff34e1c8c9d
Prolly would need entire session since it would have some helpful metadata for debugging potentially, also opencode debug config output too.
I think this is something w/ your setup so im trying to figure out what, nobody else has reported this
It didn't happen again, I'm blaming copilot API provider for the problem. Thanks,