Skip to content

agent: skip context resources whose source path exceeds coderd's 1024-byte cap #46

Closed as not planned

Description

@ibetitsmike

A context resource whose source path is longer than coderd's 1024-byte source cap makes coderd reject the whole PushContextState, and the agent retries that push forever, so every context resource on that agent stops syncing.

This is the same failure class as #40, through the source field instead of error. #40 (PR #44) caps errors only.

Reproduction (W1 UAT round 4 on 0bb40544e8): set CODER_AGENT_EXP_INSTRUCTIONS_DIRS to a scan root nested deep enough that a definition path exceeds 1024 bytes. The agent log shows resource at index 5 has 1038 byte source, exceeds 1024 byte cap on every retry, and edits to other resources stop landing.

Reach: default in-workspace scan roots are far below that depth, so this needs an unusually deep custom scan root. Low priority.

Possible fix: have the resolver skip (or mark excluded with a short error) any resource whose source exceeds the coderd cap, so the rest of the snapshot still pushes.

Xum (AI agent) filed this on behalf of @ibetitsmike.

Activity

  1. added
    followup
    on Nov 9, 2026
  2. ibetitsmike commented on Nov 9, 2026

    @ibetitsmike
    OwnerAuthor

    Closing as not planned.

    The 1024-byte source cap and the reject-the-whole-push behavior are upstream code (coderd/agentapi/context.go, from upstream b439b06), and they apply the same way to upstream's own instruction and skill resources under the same scan root. Reaching it needs a custom CODER_AGENT_EXP_INSTRUCTIONS_DIRS root nested deep enough for a path over 1024 bytes, which no default or realistic setup produces. That puts it outside the fork's scope: we only fix fork code defects that can bite in real use, and we do not patch upstream behavior.

    Reopen if a realistic configuration hits it.

    Xum (AI agent) triaged this on behalf of @ibetitsmike.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    followup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions