Skip to content
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

fix(code-interpreter): prevent agent from misusing IDs #98

Merged

Conversation

JanPokorny
Copy link
Contributor

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 whether storage.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.

@JanPokorny JanPokorny requested a review from Tomas2D October 16, 2024 14:01
src/tools/python/python.ts Show resolved Hide resolved
src/tools/python/python.ts Outdated Show resolved Hide resolved
@JanPokorny JanPokorny force-pushed the janpokorny/fix-code-interpreter-prevent-agent-from-misusing-ids branch from e9eb0d8 to cc444aa Compare October 17, 2024 14:42
@JanPokorny JanPokorny requested a review from Tomas2D October 17, 2024 14:43
@JanPokorny JanPokorny force-pushed the janpokorny/fix-code-interpreter-prevent-agent-from-misusing-ids branch from cc444aa to 84db784 Compare October 17, 2024 14:44
@JanPokorny JanPokorny marked this pull request as draft October 17, 2024 15:49
@JanPokorny JanPokorny force-pushed the janpokorny/fix-code-interpreter-prevent-agent-from-misusing-ids branch from 84db784 to 6e36872 Compare October 17, 2024 15:54
@JanPokorny JanPokorny marked this pull request as ready for review October 17, 2024 15:54
@Tomas2D Tomas2D merged commit b366007 into main Oct 18, 2024
4 checks passed
@Tomas2D Tomas2D deleted the janpokorny/fix-code-interpreter-prevent-agent-from-misusing-ids branch October 18, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants