Skip to content

prompt push fails with 409 conflict when updating existing prompt - missing parent commit option #719

@codekiln

Description

@codekiln

Description

When using langstar prompt push to update an existing prompt repository, the command fails with a 409 conflict error:

ℹ Checking if repository -/<prompt-name> exists...
✓ Repository exists
ℹ Loading schema file...
ℹ Validating schema...
ℹ ✓ Schema valid
ℹ Pushing structured prompt to -/<prompt-name> (method: json_schema)...
Error: API error: 409 - {"error":"Parent commit validation failed: reference ID <commit-hash>"}

Steps to Reproduce

  1. Pull an existing prompt: langstar prompt pull -- "-/<prompt-name>"
  2. Modify the schema (e.g., update a field type)
  3. Attempt to push the updated prompt:
    langstar prompt push \
      -o "-" \
      -r "<prompt-name>" \
      -t "$(cat template.txt)" \
      -i "var1,var2,var3" \
      --schema updated_schema.json

Expected Behavior

Either:

  1. The push should automatically fetch the latest commit hash and use it as the parent commit
  2. There should be a --parent-commit <hash> option to specify the parent commit
  3. There should be a --force option to override versioning

Current Behavior

The push fails with a 409 conflict error because the LangSmith API requires a valid parent commit reference when updating an existing prompt.

Suggested Solution

Add one or more of:

  • --parent-commit <HASH> option to specify the parent commit explicitly
  • --auto-parent flag to automatically fetch and use the latest commit as parent
  • --force flag to override (with appropriate warnings)

Environment

  • langstar version: (latest)
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions