Skip to content

Conversation

@Mr-Neutr0n
Copy link

Summary

  • Set session status to busy immediately when prompt_async is called, so /session/status correctly reflects the active state instead of remaining unknown
  • Add .catch() handler on the fire-and-forget prompt promise to reset status to idle on failure and log the error, preventing the status from getting permanently stuck
  • Add a null check for the agent returned by Agent.get() in createUserMessage to prevent TypeError: undefined is not an object (evaluating 'agent.model') when an invalid agent name is provided

Test plan

  • Call POST /:sessionID/prompt_async and verify /session/status returns busy immediately
  • Verify status transitions to idle after the prompt completes
  • Trigger an error during async prompt (e.g. invalid agent) and verify status resets to idle
  • Send a prompt with a non-existent agent name and verify a clear error message instead of a TypeError

Fixes #12860

When OPENCODE_SERVER_PASSWORD is set, the auth middleware was applied to
all routes including /global/health. Health check endpoints should be
accessible without authentication so that monitoring tools and load
balancers can verify the server is running.

Skip the basicAuth check when the request path is /global/health.

Fixes anomalyco#12805
Sync the region prefix list and region checks in getSmallModel() with
the existing getModel() logic. The crossRegionPrefixes array was missing
jp., apac., and au. entries, and the region check only handled us and eu,
causing APAC regions (ap-northeast-1, ap-southeast-2, etc.) to fall
through without proper cross-region prefix mapping.

Fixes anomalyco#12824
…agent

Set session status to busy immediately when prompt_async is called and
ensure it resets to idle on failure. Previously the fire-and-forget
prompt left status permanently unknown because errors were unhandled and
the initial busy transition was never emitted.

Also add a null check for the agent lookup in createUserMessage to
prevent TypeError when an invalid agent name is provided.

Fixes anomalyco#12860
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@Mr-Neutr0n
Copy link
Author

Closing to resubmit cleanly — this branch accidentally picked up unrelated changes.

@Mr-Neutr0n Mr-Neutr0n closed this Feb 10, 2026
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.

/session/status potentially not reporting properly

1 participant