Assistants Code Interpreter: How do you manage attachments in a thread?

I want the user to choose and manipulate the files they want Code Interpreter to work on. As a result, I have to add/remove/update the files available in a thread.

I am confused on the best practice here. Should I be updating the files on the thread level, message level, or both?

Currently I am updating the tool_resources for code_interpreter on a thread level -

const updatedThread = await openai.beta.threads.update(
        threadID,
        {
            tool_resources: { code_interpreter: {file_ids: attachments2} }
        }
    )

Then I am also referencing the file_id on a message level -

const message = await openai.beta.threads.messages.create(
        threadID,
        {
            role: "user",
            content: input,
            attachments: attachments,
        }
    )

Any guidance here would be hugely appreciated as I am confused here. Cheers.