fix(code-interpreter): prevent agent from misusing IDs #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Agent could not understand how to (not) use the IDs, so we just don't give the IDs to the agent anymore.
This has some implications regarding uniqueness of filenames, since we essentially use them as IDs now (among the results of
storage.list()
). Having these be unique used to be a soft requirement anyway, since the agent could not differentiate between files with the same name either way. The PR is written in a way where it does not matter whetherstorage.list()
returns results with non-unique filenames, it just arbitrarily picks one of the results.We should probably follow up by either forbidding upload of non-unique filenames to a conversation, or by auto-deduplicating (like browser downloads do).
Note that we still use the ID as a part of the link in the output. This does not seem to have any negative effects so it's left as-is for now.