Skip to content

Add automated auto-fix workflow and diagnostics helpers#9

Merged
aandersen2323 merged 1 commit into
mainfrom
codex/deep-dive-into-code-structure
Oct 24, 2025
Merged

Add automated auto-fix workflow and diagnostics helpers#9
aandersen2323 merged 1 commit into
mainfrom
codex/deep-dive-into-code-structure

Conversation

@aandersen2323
Copy link
Copy Markdown
Owner

Summary

  • add AutoFixRequest and helper workflow that orchestrates automated remediation attempts and fix runs
  • parse structured AutoFix responses, reuse prior run manifests, and expose a new /infer/auto-fix endpoint
  • cover the new parsing utilities with focused unit tests

Testing

  • pytest

https://chatgpt.com/codex/tasks/task_e_68fa885a93588331b62a5489ff43b6b0

@aandersen2323 aandersen2323 merged commit 272ba0c into main Oct 24, 2025
1 check failed
@aandersen2323 aandersen2323 deleted the codex/deep-dive-into-code-structure branch October 24, 2025 01:26
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/app.py
Comment on lines +531 to +556
def _parse_auto_fix_completion(text: str) -> Dict[str, Any]:
parsed = _extract_auto_fix_json(text)
if not parsed:
return {
"status": "unparsed",
"summary": (text or "").strip(),
"actions": [],
"fix_instructions": "",
"metrics": {},
"parsed": None,
"raw": text,
}

status = str(parsed.get("status", "")).lower().strip()
if status not in _VALID_AUTO_FIX_STATUSES:
status = "unparsed"

actions_raw = parsed.get("actions") or parsed.get("action_items") or []
if isinstance(actions_raw, str):
actions = [actions_raw.strip()]
else:
actions = [str(item) for item in actions_raw if item is not None]

fix_instructions = parsed.get("fix_instructions") or parsed.get("resolution") or ""
summary = parsed.get("summary") or parsed.get("analysis") or ""
metrics = parsed.get("metrics") or {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Guard against non-object JSON in auto-fix parser

_parse_auto_fix_completion assumes _extract_auto_fix_json returns a mapping and immediately calls parsed.get(...). However _extract_auto_fix_json will happily return any valid JSON value, including a list or string when the model responds with [{...}] or "...". In those cases parsed.get raises an AttributeError, causing /infer/auto-fix to 500 instead of returning an "unparsed" status. Given LLM output is not guaranteed to respect the prompt, this makes the new endpoint brittle. Consider verifying isinstance(parsed, dict) and falling back to the unstructured branch when it is not.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant