Skip to content

Interactive mode: ask user to retry with relaxed limits #239

@kyamagu

Description

@kyamagu

When conversion fails due to resource limits in CLI, prompt user to retry:

Error: Layer depth 105 exceeds limit 100.

Would you like to retry with max_layer_depth=150? [y/N]: y
Retrying with relaxed limits...
Conversion successful!

Benefits

  • Frictionless UX for users
  • No need to remember environment variable syntax
  • Can learn appropriate limits for specific files

Considerations

  • Only for interactive CLI usage (not scripts)
  • Need --no-interactive flag for CI/CD
  • Security: careful with unlimited retries
  • Should respect original environment variable settings
  • May need confirmation for very large increases

Implementation Ideas

# In __main__.py
def main():
    try:
        convert(...)
    except ResourceLimitError as e:
        if sys.stdin.isatty():  # Interactive terminal
            suggested_limits = calculate_suggested_limits(e)
            if prompt_user_retry(suggested_limits):
                convert(..., resource_limits=suggested_limits)

Open Questions

  • Should we remember user choices for this session?
  • How many retry attempts before giving up?
  • Should we suggest creating a config file for persistent settings?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions