Skip to content

acpx: apply_patch stuck in pending state after long conversations #22222

Closed as not planned

Description

@oldjs

Description

When using opencode via acpx in non-interactive (background) mode, after a session accumulates significant context (multiple rounds of continuation), apply_patch gets stuck in "pending" state indefinitely. The agent continues thinking and reading files but never actually writes anything.

Environment

  • opencode-ai: 1.4.3
  • acpx: 0.5.3
  • OS: Linux (container)
  • Model: gptloadopenai/glm (via ccload provider)
  • Mode: acpx non-interactive with --approve-all

Steps to Reproduce

  1. Create an acpx session: acpx --approve-all opencode -s mysession "task"
  2. Let the agent work for multiple rounds, accumulating context
  3. Continue the session with acpx --approve-all opencode -s mysession "continue"
  4. After 3-5 continuations, apply_patch starts showing "pending" but never completes
  5. Agent keeps thinking and reading but never writes files

Expected Behavior

apply_patch should complete and write files regardless of session length.

Actual Behavior

apply_patch stays pending forever. Only workaround is to kill the session and create a new one.

Related Issues

Activity

  1. github-actions commented on Apr 13, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These issues share the same core symptom (apply_patch/write operation hanging). If your issue is specifically triggered by long session context length (3-5 continuations) in acpx non-interactive mode, that may be a distinct reproduction path worth keeping open - but please confirm whether the workarounds from the above issues apply to your case.

  2. oldjs commented on Apr 13, 2026

    @oldjs
    Author

    22222

  3. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions