-
Notifications
You must be signed in to change notification settings - Fork 15
llm: results of chatgpt-5 agent tasked with improving readability and… #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… documentation (with diagrams)
| idx = 0 | ||
| for idx, item in enumerate(run_args): | ||
| image_index = 0 | ||
| for image_index, item in enumerate(run_args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, it missed the opportunity to excise the superfluous initialization of the index variable here. Also, arg_index seems like it would be a more appropriate expanded name.
swelborn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like some exception behavior has changed. llms tend to go overboard catching generic exceptions unless you tell them not to, and in a lot of cases you want things to fail hard or handle in a different way
other changes with opening files and variable name changes seem reasonable
| - OSError: if attaching to the namespace fails. | ||
| """ | ||
| pth = f"/proc/{pid}/ns/{ns}" | ||
| tgt = open(pth, "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old version doesn't use context mgr - is not closing the file when this func goes out of scope intended?
| return | ||
| try: | ||
| subprocess.check_call(["mount", "--rbind", src, tgt]) | ||
| except subprocess.CalledProcessError as exc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this raise? it did before...
| copy_function=shutil.copyfile, | ||
| dirs_exist_ok=True, | ||
| ) | ||
| except OSError as exc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this raise? it did before...
| shutil.copyfile(src, tgt, follow_symlinks=(not symlinks)) | ||
| try: | ||
| shutil.copyfile(src, tgt, follow_symlinks=(not symlinks)) | ||
| except OSError as exc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this raise? it did before...
| Returns | ||
| - Dict keyed by module name containing config dictionaries | ||
| """ | ||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the lazy loading...
| print("hook_tool must run as root (euid 0).", file=sys.stderr) | ||
| return 1 | ||
|
|
||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since certain exceptions get caught and don't raise here and in other places in main they will fail as a kind of warning rather than failing hard
| res.append(r) | ||
| done[id] = r | ||
| return res | ||
| def merge_records_preserve_first(record_lists, key_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice if the agent type hinted these like it did in other parts of code
| if "graphroot" in line: | ||
| val = line.rstrip().split("=")[1] | ||
| store_path = val.replace(" ", "").replace('"', "") | ||
| except FileNotFoundError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would imagine this is not desired
| try: | ||
| tasks_per_node_match = re.search(conf.ntasks_pattern, tasks_per_node_raw) | ||
| ntasks = int(tasks_per_node_match[0]) if tasks_per_node_match else 1 | ||
| except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this too ?
| text=True, | ||
| ) | ||
| help_text = proc.stdout.splitlines() | ||
| except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this too...
|
First of all thank you for spending your time looking at this LLM experiment! I'm going to close this PR, pick out some of the reasonable suggestions, and open some new focused PRs without the LLM. |
This should perhaps not be merged as is. At least not without some careful consideration.
This is an untested (as of yet) experiment to see how a coding agent performs.
That said, several of the proposed changes appear to be improvements worth considering.