Skip to content

fix(sdk): list a git type change as an updated file - #6591

Merged
VascoSch92 merged 1 commit into
mainfrom
vasco/git-type-change-status
Nov 7, 2026
Merged

VascoSch92 merged 1 commit into
mainfrom
vasco/git-type-change-status

Conversation

@VascoSch92

@VascoSch92 VascoSch92 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

just fixing a bug


AGENT:

Why

The change parser accepts M, A, D, U (plus R/C) from git diff --name-status and raises GitCommandError("Unexpected git status: T") for anything else. Git uses T for a type change, such as a regular file replaced by a symlink. One such file in the working tree makes get_changes_in_repo raise, so the agent server's /api/git/changes returns a 400 and none of the other changes are listed.

Summary

Issue Number

Part of #6348 (item: "a type change ('T', e.g. file -> symlink) is an unknown status and aborts the whole change listing").

How to Test

uv run pytest tests/sdk/git

test_get_changes_in_repo_type_change_does_not_abort_listing fails on main (GitCommandError: Unexpected git status: T) and passes here, listing both link.txt and other.txt as updated; tests/sdk/git passes (144).

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:b000470-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-b000470-python \
  ghcr.io/openhands/agent-server:b000470-python

All tags pushed for this build

ghcr.io/openhands/agent-server:b000470-golang-amd64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-golang-amd64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-golang-amd64
ghcr.io/openhands/agent-server:b000470-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:b000470-golang-arm64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-golang-arm64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-golang-arm64
ghcr.io/openhands/agent-server:b000470-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:b000470-java-amd64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-java-amd64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-java-amd64
ghcr.io/openhands/agent-server:b000470-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:b000470-java-arm64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-java-arm64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-java-arm64
ghcr.io/openhands/agent-server:b000470-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:b000470-python-amd64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-amd64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-amd64
ghcr.io/openhands/agent-server:b000470-python-node-runtime-amd64
ghcr.io/openhands/agent-server:b000470-python-arm64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-arm64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-arm64
ghcr.io/openhands/agent-server:b000470-python-node-runtime-arm64
ghcr.io/openhands/agent-server:b000470-python-minimal-amd64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-minimal-amd64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-minimal-amd64
ghcr.io/openhands/agent-server:b000470-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:b000470-python-minimal-arm64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-minimal-arm64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-minimal-arm64
ghcr.io/openhands/agent-server:b000470-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:b000470-python-slim-amd64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-slim-amd64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-slim-amd64
ghcr.io/openhands/agent-server:b000470-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:b000470-python-slim-arm64
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-slim-arm64
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-slim-arm64
ghcr.io/openhands/agent-server:b000470-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:b000470-golang
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-golang
ghcr.io/openhands/agent-server:vasco-git-type-change-status-golang
ghcr.io/openhands/agent-server:b000470-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:b000470-java
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-java
ghcr.io/openhands/agent-server:vasco-git-type-change-status-java
ghcr.io/openhands/agent-server:b000470-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:b000470-python-minimal
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-minimal
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-minimal
ghcr.io/openhands/agent-server:b000470-python-node-runtime-minimal
ghcr.io/openhands/agent-server:b000470-python-slim
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python-slim
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python-slim
ghcr.io/openhands/agent-server:b000470-python-node-runtime-slim
ghcr.io/openhands/agent-server:b000470-python
ghcr.io/openhands/agent-server:b000470d8483be10c3236c4d289bf42b0d1f2ed5-python
ghcr.io/openhands/agent-server:vasco-git-type-change-status-python
ghcr.io/openhands/agent-server:b000470-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., b000470-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., b000470-python-amd64) are also available if needed

git diff --name-status reports a type change (e.g. a file replaced by a
symlink) as "T", which the parser did not know, so get_changes_in_repo
raised GitCommandError and the whole change listing failed. Map "T" to
UPDATED.
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/git
   git_changes.py1031883%38, 95–96, 138–139, 148–150, 161–163, 192, 236–237, 239, 246–248
TOTAL54348855284% 

@all-hands-bot all-hands-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

Scope: The change lives in openhands-sdk/openhands/sdk/git/git_changes.py — squarely within this repository's ownership (Python SDK). The linked tracker item in #6348 ("a type change ('T', e.g. file -> symlink) is an unknown status and aborts the whole change listing") is labeled ready-for-dev and cross-referenced to this PR. Scope gate passes.

Correctness: git diff --name-status -z emits T with a single path (the parser's path_count logic correctly treats T as one-path, unlike R/C), and mapping it to GitChangeStatus.UPDATED is consistent with how M is treated — the path still exists and its content changed. The status enum values themselves are unchanged, so there is no REST/serialized-contract impact (the OpenAPI schema check on this head passes), and the change only widens accepted input. Since git_commits.py shares _parse_name_status, commit change listings handle T too.

Test evidence:

  • The new regression test fails on main with GitCommandError: Unexpected git status: T (reproduced via a worktree at origin/main with the head's test file) and passes on this head, satisfying the repository's rule that a bug-fix regression test fails without the fix.
  • uv run pytest tests/sdk/git passes on this head: 144 passed.
  • ruff check and ruff format --check are clean on both changed files.
  • All GitHub Actions checks on b000470d8483be10c3236c4d289bf42b0d1f2ed5 are successful.

Acceptance: The PR ports the issue's pinned test without its xfail marker, asserts the resulting status, and says "Part of #6348" as the tracker requires. No dependency changes, so the release-age policy does not apply.

No material correctness, security, compatibility, or acceptance-criterion findings.

✅ APPROVED

@VascoSch92
VascoSch92 merged commit f2d4ff1 into main Nov 7, 2026
52 of 53 checks passed
@VascoSch92
VascoSch92 deleted the vasco/git-type-change-status branch November 7, 2026 17:18
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.

2 participants